big oauth improvements

This commit is contained in:
les
2020-01-21 01:24:10 +01:00
parent d1dbbebffb
commit e0b3dd8d4a
18 changed files with 289 additions and 172 deletions

View File

@@ -5,13 +5,14 @@ module.exports = (sequelize, DataTypes) => {
type: DataTypes.STRING,
primaryKey: true
},
expiresAt: DataTypes.DATE,
scope: DataTypes.STRING,
redirect_uri: DataTypes.STRING
}, {})
OAuthCode.associate = function (models) {
OAuthCode.belongsTo(models.user)
OAuthCode.belongsTo(models.oauth_client)
OAuthCode.belongsTo(models.oauth_client, { as: 'client' })
}
return OAuthCode