User Authentication
ZexaNext uses Auth.js for user authentication. Auth.js previously NextAuth is a complete open-source authentication solution for Next.js applications.
You can configure it in the app/api/auth/[...nextauth]/route.ts
file.
Add the following env variables to your .env
file:
ZexaNext provides 3 built-in authentication providers: Google, Github and Email.
Login and Registration
Once you have configured the authentication provider, you use /auth/login
page for login and /auth/register
page for user registration. You can edit the default login redirect in config/route.ts
file.
Generally you would want to redirect the user to the dashboard page after login.
Forgot Password
We have also provided a forgot password option in the login page which sends an email to the user with a link to reset the password. You can check forgot password page at /auth/reset
.