Files
overleaf-cep/services/web/app/src/models/OauthAuthorizationCode.js
Jimmy Domagala-Tang c6824f8649 Merge pull request #21838 from overleaf/jdt-ae-wf-codec-challenge
[Web] Enable PKCE flows for Oauth server

GitOrigin-RevId: e9a61596ed64e2be8b038b35eb8ea3e21b772e97
2025-01-28 09:05:31 +00:00

29 lines
697 B
JavaScript

const mongoose = require('../infrastructure/Mongoose')
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' },
codeChallenge: String,
codeChallengeMethod: String,
},
{
collection: 'oauthAuthorizationCodes',
minimize: false,
}
)
exports.OauthAuthorizationCode = mongoose.model(
'OauthAuthorizationCode',
OauthAuthorizationCodeSchema
)
exports.OauthAuthorizationCodeSchema = OauthAuthorizationCodeSchema