feat(02-01): install next-auth@4, configure CredentialsProvider auth
- Add next-auth@4 dependency (stable v4, not beta v5) - Create src/lib/auth.ts with CredentialsProvider validating ADMIN_EMAIL/ADMIN_PASSWORD env vars - Create src/app/api/auth/[...nextauth]/route.ts catch-all handler (GET + POST) - JWT session strategy — stateless, no DB users table - Custom sign-in page set to /admin/login - Add NEXTAUTH_URL, NEXTAUTH_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD to .env.local
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
"lucide-react": "^1.14.0",
|
||||
"nanoid": "^5.1.11",
|
||||
"next": "16.2.6",
|
||||
"next-auth": "^4.24.14",
|
||||
"postgres": "^3.4.9",
|
||||
"react": "19.2.4",
|
||||
"react-dom": "19.2.4",
|
||||
|
||||
Reference in New Issue
Block a user