Key Features:
- ๐ Next-auth v5 (Auth.js)
- ๐ Next.js 14 with server actions
- ๐ Credentials Provider
- ๐ Forgot password functionality
- โ๏ธ Email verification
- ๐ฑ Two factor verification
- ๐ฅ User roles (Admin & User)
- ๐ Login component (Opens in redirect or modal)
- ๐ Register component
- ๐ค Forgot password component
- โ Verification component
โ ๏ธ Error component- ๐ Login button
- ๐ช Logout button
- ๐ง Role Gate
- ๐ Exploring next.js middleware
- ๐ Extending & Exploring next-auth session
- ๐ Exploring next-auth callbacks
- ๐ค useCurrentUser hook
- ๐ useRole hook
- ๐ง currentUser utility
- ๐ฎ currentRole utility
- ๐ฅ๏ธ Example with server component
- ๐ป Example with client component
- ๐ Render content for admins using RoleGate component
- ๐ก๏ธ Protect API Routes for admins only
- ๐ Protect Server Actions for admins only
- ๐ง Change email with new verification in Settings page
- ๐ Change password with old password confirmation in Settings page
- ๐ Enable/disable two-factor auth in Settings page
- ๐ Change user role in Settings page (for development purposes only)
DATABASE_URL=
DIRECT_URL=
AUTH_SECRET=
EMAIL_FROM=
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASS=
SMTP_SECURE=true
NEXT_PUBLIC_APP_URL=
npx prisma generate
npx prisma db push
npm run dev
Running commands with npm npm run [command]
command | description |
---|---|
dev |
Starts a development instance of the app |