mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 09:02:01 +01:00
19 lines
459 B
JavaScript
19 lines
459 B
JavaScript
|
|
module.exports = (sequelize, DataTypes) => {
|
|
const OAuthCode = sequelize.define('oauth_code', {
|
|
authorizationCode: {
|
|
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, { as: 'client' })
|
|
}
|
|
|
|
return OAuthCode
|
|
}
|