2019-11-18 09:03:20 -05:00
|
|
|
const mongoose = require('../infrastructure/Mongoose')
|
2019-05-29 05:21:06 -04:00
|
|
|
|
|
|
|
const { Schema } = mongoose
|
|
|
|
const { ObjectId } = Schema
|
|
|
|
|
|
|
|
const OauthAuthorizationCodeSchema = new Schema(
|
|
|
|
{
|
|
|
|
authorizationCode: String,
|
|
|
|
expiresAt: Date,
|
|
|
|
oauthApplication_id: { type: ObjectId, ref: 'OauthApplication' },
|
|
|
|
redirectUri: String,
|
|
|
|
scope: String,
|
|
|
|
user_id: { type: ObjectId, ref: 'User' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
collection: 'oauthAuthorizationCodes'
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2019-11-18 09:03:20 -05:00
|
|
|
exports.OauthAuthorizationCode = mongoose.model(
|
2019-05-29 05:21:06 -04:00
|
|
|
'OauthAuthorizationCode',
|
|
|
|
OauthAuthorizationCodeSchema
|
|
|
|
)
|
|
|
|
|
|
|
|
exports.OauthAuthorizationCodeSchema = OauthAuthorizationCodeSchema
|