Embed "direct" login button on site pages #2944
-
Currently the flow to login looks like this:
What I'd like to do is take the button(s) from the signing page (step 2) and put them on my main page. I only use twitter for auth (because it's a website of twitter services), and our users would do better to just click a "login" button from the main page and go directly to twitter. I've searched through the discussions, I'm not finding this answered. I have seen "make your own custom UI page" type answers in the issues section, but it's unclear how to do that. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
(sigh) putting this answer for anyone who's looking for the same thing and hit this question. I coulda had a V8. It's as simple as: `import { signIn } from "next-auth/react"; ... <button onClick={() => signIn('twitter')}>Sign in ` where you can replace You can also import getProviders if you have more than one and map() them on the page: Example here: |
Beta Was this translation helpful? Give feedback.
(sigh) putting this answer for anyone who's looking for the same thing and hit this question.
I coulda had a V8.
It's as simple as:
`import { signIn } from "next-auth/react";
...
<button onClick={() => signIn('twitter')}>Sign in
`
where you can replace
twitter
with whatever your provider is.You can also import getProviders if you have more than one and map() them on the page:
Example here:
https://next-auth.js.org/configuration/pages#oauth-sign-in