Next.js Discord

Discord Forum

Nextauth login page

Unanswered
! nolikas posted this in #help-forum
Open in Discord
Is there any way for me to modify this next-auth premade login page? I don't have this page in my code, but when I click on button with next-auth's function signIn() I get redirected to it. I'm using next-auth with next-auth-steam.

18 Replies

Use signIn('steam') to skip this. I think you can also specify your own custom login page through the pages config of next auth
@! nolikas Is there any way for me to modify this next-auth premade login page? I don't have this page in my code, but when I click on button with next-auth's function `signIn()` I get redirected to it. I'm using `next-auth` with `next-auth-steam`.
Carolina Dog
Yes you can.
You create a custom page for sign in (e.g. in /auth/sign-in). Then you can configure pages property in next auth options. For more information read https://next-auth.js.org/configuration/pages.
Thanks for the help ❤️
Okay, I got the custom page up, but how do I configure the redirect url for the button?
@! nolikas Okay, I got the custom page up, but how do I configure the redirect url for the button?
signIn('steam', { callbackUrl: "/" })

like this i think
let me try one sec
Ok it works, but...
my page keeps redirecting to "/"
do you get redirect if just using signIn('steam')?
just removed he callbackurl and everything is fine now
does it redirect you to "/"?
I click on the auth button and I instantly get taken to steam auth
@Ray does it redirect you to "/"?
yup
ah ok by default it will redirect to "/"
No by default it will send you back to the page you started the login on
Yeah, I modified it after some time so it redirects to /