OauthAccessToken.js 613 B

1234567891011121314151617181920212223242526
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const { ObjectId } = Schema
  4. const OauthAccessTokenSchema = new Schema(
  5. {
  6. accessToken: String,
  7. accessTokenExpiresAt: Date,
  8. oauthApplication_id: { type: ObjectId, ref: 'OauthApplication' },
  9. refreshToken: String,
  10. refreshTokenExpiresAt: Date,
  11. scope: String,
  12. user_id: { type: ObjectId, ref: 'User' },
  13. },
  14. {
  15. collection: 'oauthAccessTokens',
  16. }
  17. )
  18. exports.OauthAccessToken = mongoose.model(
  19. 'OauthAccessToken',
  20. OauthAccessTokenSchema
  21. )
  22. exports.OauthAccessTokenSchema = OauthAccessTokenSchema