mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 06:29:23 +02:00
generate 2fa backup codes
This commit is contained in:
parent
dca6924a5c
commit
3df14fb8f5
4 changed files with 40 additions and 5 deletions
|
@ -83,6 +83,14 @@ export const users = sqliteTable("user", {
|
|||
.default(false),
|
||||
});
|
||||
|
||||
export const twoFactorBackupCodes = sqliteTable("twoFactorBackupCodes", {
|
||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||
userId: text("userId")
|
||||
.notNull()
|
||||
.references(() => users.id, { onDelete: "cascade" }),
|
||||
codeHash: text("codeHash").notNull(),
|
||||
});
|
||||
|
||||
// Sessions table
|
||||
export const sessions = sqliteTable("session", {
|
||||
id: text("id").primaryKey(), // has to be id not sessionId for lucia
|
||||
|
@ -124,3 +132,4 @@ export type Session = InferSelectModel<typeof sessions>;
|
|||
export type EmailVerificationCode = InferSelectModel<
|
||||
typeof emailVerificationCodes
|
||||
>;
|
||||
export type TwoFactorBackupCode = InferSelectModel<typeof twoFactorBackupCodes>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue