Comprehensive authentication system using NextAuth.js with multiple providers and custom registration flows.
User Registration → Database Creation → Auto-Login → Dashboard Redirect/api/auth/register with user dataSign-In Form → Credentials/OAuth Validation → Session Creation → RedirectAuthentication Methods:
model User {
id String @id @default(cuid())
name String?
email String @unique
emailVerified DateTime?
image String?
password String? // Hashed for credential users
accounts Account[]
sessions Session[]
favorites UserFavorite[]
visits OpeningVisit[]
practiceSessions PracticeSession[]
// User Preferences
preferredDepth Int @default(13)
showBestMoveArrow Boolean @default(true)
showPonderArrow Boolean @default(true)
defaultBoardOrientation String @default("white")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}