Next.js Discord

Discord Forum

Differentiating between NextAuth Providers

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Avatar
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

Avatar
Naeem
you can use signIn like this:
//for google
signIn("google")
//for creds
signIn("credentials",{...})
Avatar
Sloth bearOP
Yes that's how I'm using it
Avatar
Naeem
so what's the issue exactly??
Avatar
Sloth bearOP
both authorize and signIn are being called, is that normal?
Avatar
Naeem
yes that's the normal flow of nextAuth
Avatar
Sloth bearOP
Okay just clarifying! So I'll just do the checks within signIn?
Avatar
Naeem
I'm not getting your point here?