Merge branch 'main' into feat/webauthn

This commit is contained in:
Ruben Talstra 2025-02-22 14:28:12 +01:00 committed by GitHub
commit 8173f5fca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
132 changed files with 5513 additions and 769 deletions

View file

@ -39,12 +39,18 @@ const Session = mongoose.Schema({
},
});
const backupCodeSchema = mongoose.Schema({
codeHash: { type: String, required: true },
used: { type: Boolean, default: false },
usedAt: { type: Date, default: null },
});
const passkeySchema = mongoose.Schema({
id: { type: String, required: true },
publicKey: { type: Buffer, required: true },
counter: { type: Number, default: 0 },
transports: { type: [String], default: [] },
});
});
/** @type {MongooseSchema<MongoUser>} */
const userSchema = mongoose.Schema(
@ -130,7 +136,12 @@ const userSchema = mongoose.Schema(
},
plugins: {
type: Array,
default: [],
},
totpSecret: {
type: String,
},
backupCodes: {
type: [backupCodeSchema],
},
refreshToken: {
type: [Session],