Next.js Discord

Discord Forum

Differentiating between NextAuth Providers

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
My app allows auth using credentials/google. I'm using the signIn callback function for Google but I realise that it gets called when I sign in using credentials as well. Do I not need the authorise function for credentials in this case? Or is there a proper way of checking for the provider that's calling the function? Thanks!

7 Replies

you can use signIn like this:
//for google
signIn("google")
//for creds
signIn("credentials",{...})
so what's the issue exactly??
@Naeemgg so what's the issue exactly??
Sloth bearOP
both authorize and signIn are being called, is that normal?
yes that's the normal flow of nextAuth
@Naeemgg yes that's the normal flow of nextAuth
Sloth bearOP
Okay just clarifying! So I'll just do the checks within signIn?