Skip to content
Discussion options

You must be logged in to vote

You will need a different id for the two providers. Since you are not defining one, both default to "credentials" and thus only showing one of them.

Say you add id: "register" to one and id: "login" to the other. You would then do signIn("register") or signIn("login") in your client code.

See: https://next-auth.js.org/configuration/providers/credentials-provider#options

As a suggestion, if your backend is in API routes, don't use a fetch, just import the logic of login and registration for a minor performance boost.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Nurtilekk
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants