feat: add authorization

This commit is contained in:
2026-08-13 15:03:51 +03:00
parent ab21426478
commit 4cbfc2621c
25 changed files with 952 additions and 114 deletions
+22
View File
@@ -7,3 +7,25 @@ generator client {
datasource db {
provider = "sqlite"
}
model User {
id String @id
email String @unique
passwordHash String
sessions Session[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Session {
id String @id
userId String
refreshTokenHash String
expiresAt DateTime
revokedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
}