feat: added user-locking on mfa failure

This commit is contained in:
Sheen Capadngan
2024-05-22 21:55:56 +08:00
parent 880289217e
commit 41d72d5dc6
11 changed files with 240 additions and 12 deletions
+8 -2
View File
@@ -22,9 +22,15 @@ export const UsersSchema = z.object({
updatedAt: z.date(),
isGhost: z.boolean().default(false),
username: z.string(),
isEmailVerified: z.boolean().default(false).nullable().optional()
isEmailVerified: z.boolean().default(false).nullable().optional(),
consecutiveFailedMfaAttempts: z.number(),
isLocked: z.boolean(),
temporaryLockDateEnd: z.date().nullable().optional()
});
export type TUsers = z.infer<typeof UsersSchema>;
export type TUsersInsert = Omit<z.input<typeof UsersSchema>, TImmutableDBKeys>;
export type TUsersInsert = Omit<
z.input<typeof UsersSchema>,
TImmutableDBKeys | "isLocked" | "consecutiveFailedMfaAttempts"
>;
export type TUsersUpdate = Partial<Omit<z.input<typeof UsersSchema>, TImmutableDBKeys>>;