feat: email verification + delete confirmation + smtp/cors/prod hardening

This commit is contained in:
2026-02-09 14:46:49 -06:00
parent 27cc7d159b
commit 9856317641
22 changed files with 896 additions and 58 deletions

View File

@@ -25,6 +25,8 @@ model User {
email String @unique
passwordHash String?
displayName String?
emailVerified Boolean @default(false)
seenUpdateVersion Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -43,6 +45,7 @@ model User {
allocations Allocation[]
transactions Transaction[]
budgetSessions BudgetSession[]
emailTokens EmailToken[]
}
model VariableCategory {
@@ -161,3 +164,18 @@ model BudgetSession {
@@unique([userId, periodStart])
@@index([userId, periodStart])
}
model EmailToken {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
type String // "signup" | "delete"
usedAt DateTime?
tokenHash String
expiresAt DateTime
createdAt DateTime @default(now())
@@index([userId, type])
@@index([userId, type, expiresAt])
@@index([tokenHash])
}