added 2FA

This commit is contained in:
2024-04-26 22:16:21 +03:00
parent 53cadc289a
commit f17a002ac6
38 changed files with 1036 additions and 414 deletions

View File

@@ -26,15 +26,17 @@ enum UserRole {
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
password String?
role UserRole @default(CUSTOMER)
extendedData Json?
accounts Account[]
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
password String?
role UserRole @default(CUSTOMER)
extendedData Json?
accounts Account[]
isTwoFactorEnabled Boolean @default(false)
twoFactorComfirmation TwoFactorComfirmation?
}
model Account {
@@ -73,3 +75,18 @@ model PasswordResetToken {
@@unique([email, token])
}
model TwoFactorToken {
id String @id @default(cuid())
email String
token String @unique
expires DateTime
@@unique([email, token])
}
model TwoFactorComfirmation {
id String @id @default(cuid())
userId String @unique
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}