mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
e89c9128c3
[web] Add `domainVerifications` collection GitOrigin-RevId: 5a9fe9ea80ecf76af9802014149ae785cc4412d5
34 lines
789 B
JavaScript
34 lines
789 B
JavaScript
import mongoose from '../infrastructure/Mongoose.mjs'
|
|
const { Schema } = mongoose
|
|
|
|
export const DomainVerificationSchema = new Schema(
|
|
{
|
|
domain: {
|
|
type: String,
|
|
required: true,
|
|
unique: true,
|
|
},
|
|
token: { type: String, required: true },
|
|
status: {
|
|
type: String,
|
|
enum: ['pending', 'verified', 'failed'],
|
|
default: 'pending',
|
|
},
|
|
createdAt: { type: Date, default: Date.now },
|
|
verifiedAt: Date,
|
|
reverifiedAt: Date,
|
|
verificationAttemptCount: { type: Number, default: 0 },
|
|
groupId: Schema.Types.ObjectId,
|
|
lastVerificationAttemptAt: Date,
|
|
},
|
|
{
|
|
collection: 'domainVerifications',
|
|
minimize: false,
|
|
}
|
|
)
|
|
|
|
export const DomainVerification = mongoose.model(
|
|
'DomainVerification',
|
|
DomainVerificationSchema
|
|
)
|