Add complete user authentication with NextAuth.js supporting: - Email/password credentials authentication - OAuth providers (GitHub, Google) with optional configuration - JWT-based session management with 30-day expiry - Role-based access control (USER, GROWER, FARM_MANAGER, ADMIN) - Permission system with granular access control - Secure password hashing with bcrypt (12 rounds) - Rate limiting on auth endpoints - Password reset flow with secure tokens - Email verification system Files added: - lib/auth/: Core auth library (types, permissions, context, hooks, middleware) - pages/api/auth/: Auth API routes (NextAuth, register, forgot-password, verify-email) - pages/auth/: Auth pages (signin, signup, forgot-password, reset-password, verify-email) - components/auth/: Reusable auth components (LoginForm, RegisterForm, AuthGuard, etc.) Updated _app.tsx to include SessionProvider for auth state management.
5 lines
270 B
TypeScript
5 lines
270 B
TypeScript
export { LoginForm } from './LoginForm'
|
|
export { RegisterForm } from './RegisterForm'
|
|
export { PasswordResetForm } from './PasswordResetForm'
|
|
export { SocialLoginButtons, SocialDivider } from './SocialLoginButtons'
|
|
export { AuthGuard, withAuthGuard } from './AuthGuard'
|