Add authentication system and admin panel
- Implement JWT-based authentication with login/logout - Add user management routes and middleware - Create admin panel for managing words and categories - Add authentication store and API client - Update database schema with User model - Configure CORS and authentication middleware - Add login page and protected routes
This commit is contained in:
@@ -8,17 +8,25 @@ generator client {
|
||||
datasource db {
|
||||
provider = "mysql"
|
||||
url = env("DATABASE_URL")
|
||||
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// AUTHENTICATION & USERS
|
||||
// ============================================
|
||||
|
||||
enum UserRole {
|
||||
ADMIN
|
||||
USER
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
email String @unique
|
||||
displayName String? @map("display_name")
|
||||
passwordHash String? @map("password_hash")
|
||||
role UserRole @default(USER)
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
authProvider String @default("local") @map("auth_provider") // local, google, microsoft
|
||||
providerId String? @map("provider_id")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
Reference in New Issue
Block a user