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.
54 lines
1.6 KiB
JSON
54 lines
1.6 KiB
JSON
{
|
|
"name": "localgreenchain",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev": "next dev -p 3001",
|
|
"build": "next build",
|
|
"start": "next start -p 3001",
|
|
"preview": "bun run build && bun run start",
|
|
"lint": "next lint",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"test:coverage": "jest --coverage",
|
|
"cy:open": "cypress open",
|
|
"cy:run": "cypress run",
|
|
"test:e2e": "start-server-and-test 'bun run preview' http://localhost:3001 cy:open",
|
|
"test:e2e:ci": "start-server-and-test 'bun run preview' http://localhost:3001 cy:run"
|
|
},
|
|
"dependencies": {
|
|
"@next-auth/prisma-adapter": "^1.0.7",
|
|
"@prisma/client": "^7.0.0",
|
|
"@tailwindcss/forms": "^0.4.0",
|
|
"@tailwindcss/typography": "^0.5.1",
|
|
"@tanstack/react-query": "^4.0.10",
|
|
"bcryptjs": "^3.0.3",
|
|
"classnames": "^2.3.1",
|
|
"drupal-jsonapi-params": "^1.2.2",
|
|
"html-react-parser": "^1.2.7",
|
|
"next": "^12.2.3",
|
|
"next-auth": "^4.24.13",
|
|
"next-drupal": "^1.6.0",
|
|
"nprogress": "^0.2.0",
|
|
"react": "^17.0.2",
|
|
"react-dom": "^17.0.2",
|
|
"react-hook-form": "^7.8.6",
|
|
"socks-proxy-agent": "^8.0.2"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.12.9",
|
|
"@types/bcryptjs": "^3.0.0",
|
|
"@types/jest": "^29.5.0",
|
|
"@types/node": "^17.0.21",
|
|
"@types/react": "^17.0.0",
|
|
"autoprefixer": "^10.4.2",
|
|
"eslint-config-next": "^12.0.10",
|
|
"jest": "^29.5.0",
|
|
"postcss": "^8.4.5",
|
|
"prisma": "^7.0.0",
|
|
"tailwindcss": "^3.0.15",
|
|
"ts-jest": "^29.1.0",
|
|
"typescript": "^4.5.5"
|
|
}
|
|
}
|