Add authentication system with next-auth (CredentialsProvider + JWT)
- Login page with email/password - Auth middleware (proxy) protecting all routes - Seed endpoint for admin user creation (admin@optiquestock.com / admin123) - Session provider wrapping root layout - User info + logout button in header - Updated POS sales route to track authenticated user
This commit is contained in:
7
src/components/auth/SessionProvider.tsx
Normal file
7
src/components/auth/SessionProvider.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { SessionProvider as NextAuthSessionProvider } from 'next-auth/react'
|
||||
|
||||
export default function SessionProvider({ children }: { children: React.ReactNode }) {
|
||||
return <NextAuthSessionProvider>{children}</NextAuthSessionProvider>
|
||||
}
|
||||
Reference in New Issue
Block a user