feat: add authentication support and user model

- Updated `env.example` to include NextAuth configuration for authentication.
- Added `next-auth` dependency to manage user sessions.
- Introduced `User` model in Prisma schema with fields for user details and password hashing.
- Integrated `AuthProvider` in layout for session management across the app.
- Enhanced `Header` component with `AuthButton` for user authentication controls.
This commit is contained in:
Julien Froidefond
2025-09-30 21:49:52 +02:00
parent 43c141d3cd
commit 17b86b6087
20 changed files with 1418 additions and 13 deletions

31
src/types/next-auth.d.ts vendored Normal file
View File

@@ -0,0 +1,31 @@
import NextAuth from "next-auth"
declare module "next-auth" {
interface Session {
user: {
id: string
email: string
name: string
firstName?: string
lastName?: string
avatar?: string
role: string
}
}
interface User {
id: string
email: string
name: string
firstName?: string
lastName?: string
avatar?: string
role: string
}
}
declare module "next-auth/jwt" {
interface JWT {
id: string
}
}