This is a demo of a Next.js project with Auth.js(NextAuth.js) for authentication.

Features

Page structure:
There are total 8 pages
  • - "/" : Home page.
  • - "/login" : Login page.
  • - "/register" : User registration page.
  • - "/password-reset" : A page for user who forgot there password to request password reset.
  • - "/update-password": A page for user to reset their password.
  • - "/my-account": User dashboard page.(For logged in user)
  • - "/change-password": A page for user to update password.(For logged in user)
  • - "/two-factor-auth": A page for user to enable or disable two factor authentication.(For logged in user)
Forms

- All forms are created by Shadcn Form(which use React Hook Form) component with zod validation

- All functionality are performed by server actions.

Style

- Styling are mainly from Shadcn components and tailwind CSS classes.

User

- Non-user can create user account

user change password

- Logged in user can change their password, enable / disable Google two factor authentication and reset password.

user change password
user enable 2FA
user 2FA QR-code
user 2FA OTP
Data

- Data of this project are linked to Neon database

- Using Drizzle ORM for data schemas and interactions.