OauthAuthorizationCode.js 637 B

1234567891011121314151617181920212223242526
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const { ObjectId } = Schema
  4. const OauthAuthorizationCodeSchema = new Schema(
  5. {
  6. authorizationCode: String,
  7. expiresAt: Date,
  8. oauthApplication_id: { type: ObjectId, ref: 'OauthApplication' },
  9. redirectUri: String,
  10. scope: String,
  11. user_id: { type: ObjectId, ref: 'User' },
  12. },
  13. {
  14. collection: 'oauthAuthorizationCodes',
  15. minimize: false,
  16. }
  17. )
  18. exports.OauthAuthorizationCode = mongoose.model(
  19. 'OauthAuthorizationCode',
  20. OauthAuthorizationCodeSchema
  21. )
  22. exports.OauthAuthorizationCodeSchema = OauthAuthorizationCodeSchema