2019-12-26 11:46:21 +01:00
|
|
|
|
|
|
|
|
module.exports = (sequelize, DataTypes) => {
|
|
|
|
|
const OAuthCode = sequelize.define('oauth_code', {
|
|
|
|
|
authorizationCode: {
|
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
|
primaryKey: true
|
|
|
|
|
},
|
2020-01-21 01:24:10 +01:00
|
|
|
expiresAt: DataTypes.DATE,
|
2019-12-26 11:46:21 +01:00
|
|
|
scope: DataTypes.STRING,
|
|
|
|
|
redirect_uri: DataTypes.STRING
|
|
|
|
|
}, {})
|
|
|
|
|
|
|
|
|
|
OAuthCode.associate = function (models) {
|
|
|
|
|
OAuthCode.belongsTo(models.user)
|
2020-01-21 01:24:10 +01:00
|
|
|
OAuthCode.belongsTo(models.oauth_client, { as: 'client' })
|
2019-12-26 11:46:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OAuthCode
|
|
|
|
|
}
|