feat: integrate NextAuth.js for authentication, update database service to use better-sqlite3 adapter, and enhance header component with user session management

This commit is contained in:
Julien Froidefond
2025-11-27 13:08:09 +01:00
parent 68ef3731fa
commit 6a9bf88a65
15 changed files with 965 additions and 31 deletions

10
src/middleware.ts Normal file
View File

@@ -0,0 +1,10 @@
import NextAuth from 'next-auth';
import { authConfig } from '@/lib/auth.config';
export default NextAuth(authConfig).auth;
export const config = {
// Match all paths except static files and api routes that don't need auth
matcher: ['/((?!api/auth|_next/static|_next/image|favicon.ico).*)'],
};