Skip to content
Advertisement

Next-Auth : How the registration is handled with a email + password credential provider?

How the registration is handled with a custom credential provider ( email + password)?

Currently my [...nextauth].js looks like this:

JavaScript

All tutorials I found online only shows the login/signIn without details on how to implement registration

Advertisement

Answer

Registration is the process of registering the user, saving new users’ credentials into the database. It is independent of next-auth. You create a form, submit the form and save the form data properly into the database.

next-auth takes over when you are logged in, in other words, you are authenticated meaning that you are already a registered, genuine user. Once you pass the security checks and successfully logged in, next-auth creates a session for the user.

You can view the set up demo for v4: next-auth 4 session returns null, next.js

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement