Skip providers page if there's only one provider listed #3079
-
Hello! I have an app where we only integrate with one provider (e.g. for an internal app) Is there any way to set it to bypass the "Sign in with..." page, and instead go directly to the idp's login page? I've looked through the providers docs but haven't seen anything. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Absolutely: https://next-auth.js.org/getting-started/client#starts-oauth-sign-in-flow-when-clicked |
Beta Was this translation helpful? Give feedback.
-
Someone did a great job here |
Beta Was this translation helpful? Give feedback.
-
Replace <button onClick={() => signIn()}>
Sign In
</button> with <button onClick={() => signIn('github')}>
Sign In
</button> and that is it, no need for middlewares. |
Beta Was this translation helpful? Give feedback.
-
Just in case it helps someone, using React Server Components, I was able to skip the provider page configuring a custom page for signin which is a Server Component with the following code: https://gist.github.com/leog/8f713ba75e83d1ddd220455e3a89ee0c |
Beta Was this translation helpful? Give feedback.
Absolutely: https://next-auth.js.org/getting-started/client#starts-oauth-sign-in-flow-when-clicked