-
Could straight to trigger provider after clicked the signin instead of redirect to api provider page. Example, I have provide few OAuth button to signin, i hope it able straight trigger the OAuth(facebook) when user clicked the button. I know there has custom signin page for next-auth. But it not suit for my case, my signIn form is a popup component instead of a page. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's a bit hard to understand exactly what you want here, but If you're wanting the sign in to be approved and everything without a redirect to the provider's page, you can't. You have to get consent from the user that is signing in through the provider's OAuth login page, then redirected back to your OAuth redirect URL. If you're talking about not going to the Next-Auth signin provider page but rather directly to the OAuth provider page, you can pass the provider name directly to the signIn() method like this: <button onClick={() => signIn()}>Sign in</button> // Redirects to sign in page when clicked
<button onClick={() => signIn('google')}>Sign in with Google</button> // Starts Google OAuth sign-in flow when clicked Read more here https://next-auth.js.org/getting-started/client#signin |
Beta Was this translation helpful? Give feedback.
It's a bit hard to understand exactly what you want here, but If you're wanting the sign in to be approved and everything without a redirect to the provider's page, you can't. You have to get consent from the user that is signing in through the provider's OAuth login page, then redirected back to your OAuth redirect URL.
If you're talking about not going to the Next-Auth signin provider page but rather directly to the OAuth provider page, you can pass the provider name directly to the signIn() method like this: