mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 23:29:00 +02:00
fb1f61434a
Delete expired OAuth tokens and authorization codes GitOrigin-RevId: 2743ed12a11101a383c46de93deabc5cdeeddc5b
29 lines
655 B
JavaScript
29 lines
655 B
JavaScript
const mongoose = require('../infrastructure/Mongoose')
|
|
|
|
const { Schema } = mongoose
|
|
const { ObjectId } = Schema
|
|
|
|
const OauthAccessTokenSchema = new Schema(
|
|
{
|
|
accessToken: String,
|
|
accessTokenExpiresAt: Date,
|
|
oauthApplication_id: { type: ObjectId, ref: 'OauthApplication' },
|
|
refreshToken: String,
|
|
refreshTokenExpiresAt: Date,
|
|
scope: String,
|
|
user_id: { type: ObjectId, ref: 'User' },
|
|
expiresAt: Date,
|
|
},
|
|
{
|
|
collection: 'oauthAccessTokens',
|
|
minimize: false,
|
|
}
|
|
)
|
|
|
|
exports.OauthAccessToken = mongoose.model(
|
|
'OauthAccessToken',
|
|
OauthAccessTokenSchema
|
|
)
|
|
|
|
exports.OauthAccessTokenSchema = OauthAccessTokenSchema
|