Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magic links are redirecting to localhost #403

Closed
realsubinbabu opened this issue Mar 17, 2023 · 9 comments
Closed

magic links are redirecting to localhost #403

realsubinbabu opened this issue Mar 17, 2023 · 9 comments
Labels
Bug 🐛 Something isn't working

Comments

@realsubinbabu
Copy link

Hello bro, after the latest update to v2.11.5, all of my magic links are redirecting to localhost.

magic link

@baptisteArno
Copy link
Owner

I'm thinking maybe NEXTAUTH_URL_INTERNAL is overriding this. Do you confirm that you have this variable set up to http://localhost:3000?

@realsubinbabu
Copy link
Author

realsubinbabu commented Mar 17, 2023

Do you confirm that you have this variable set up to http://localhost:3000?

yes bro

Edited: I just removed it and tried again, and it works now.

@baptisteArno
Copy link
Owner

Ok, I've opened an issue on nextauth repo nextauthjs/next-auth#6983

Thank you for the info 🙏

@arladmin
Copy link

arladmin commented Mar 27, 2023

@baptisteArno
Hi.
I'm facing the same problem.

If i remove the env variable NEXTAUTH_URL_INTERNAL from the config, then the app just doesn't work.

@baptisteArno baptisteArno added the Bug 🐛 Something isn't working label Mar 28, 2023
@arladmin
Copy link

Hi @baptisteArno .

I just downloaded the latest release (v2.11.7).

Now, although the link in the mail starts with my actual domain, it ultimately redirects to localhost:3000

So, the magic link is still not working.

@arladmin
Copy link

@baptisteArno
Just checked the browser console.

When i enter the magic link in the url, the response is a 302 redirect to http://localhost:3000 (NEXTAUTH_URL_INTERNAL), which , i think, should instead be NEXTAUTH_URL .

@baptisteArno
Copy link
Owner

Thank you for the report!

@arladmin
Copy link

arladmin commented Mar 28, 2023

@baptisteArno
Hey man, just tried again, with 2.11.8

Although, the link now includes the proper callbackUrl:
https://my-domain/api/auth/callback/email?email=my-email&token=f840a08c76cfcd7028d1553b06419f7c8d11d3b05249e5771ea1cdd562afe2c9&callbackUrl=https%3A%2F%2Fmy-domain%2Fsignin,
it still redirects to http://localhost:3000.

Also, when i logout, even then it redirects to the same internal url.

@baptisteArno
Copy link
Owner

Argh that's a pain in the ass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants