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

Unable to stop redirect with email signIn #1546

Closed
1 of 5 tasks
alex-cory opened this issue Mar 18, 2021 · 4 comments
Closed
1 of 5 tasks

Unable to stop redirect with email signIn #1546

alex-cory opened this issue Mar 18, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@alex-cory
Copy link
Contributor

Describe the bug
In the docs it says signIn('email', { redirect: false }) should keep you on the same page, but it doesn't. It still redirects to /api/auth/verify-request?provider=email&type=email. I upgraded to v3.13.0 to see if that helped but it did not.

Steps to reproduce
I have it set up like this

signIn('email', { redirect: false })`

Include a link to public repository which can be used to reproduce the behaviour.

Expected behavior
I expect it to not redirect to /api/auth/verify-request?provider=email&type=email

Screenshots or error logs
Here are the logs from the server

[next-auth][debug][typeorm_get_user_by_email] alexcoryregister@gmail.com
[next-auth][debug][typeorm_create_verification_request] alexcoryregister@gmail.com
REDIRECT http://a.local:3000/?forYou=true <- this was called in the redirect callback

Mar-18-2021 12-39-19

Additional context
Seems like issue #1542 has the same problem he's just reporting something different. Notice he has redirect: false but it's still redirecting.

Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.

  • Found the documentation helpful
  • Found documentation but was incomplete
  • Could not find relevant documentation
  • Found the example project helpful
  • Did not find the example project helpful
@alex-cory alex-cory added the bug Something isn't working label Mar 18, 2021
@bduff9
Copy link

bduff9 commented Mar 18, 2021

@alex-cory Just saw this. FYI, my page is not redirecting. The redirect: false is working as expected. What I am seeing is after successful sign in (i.e. the page I enter the email on stays on that page, but I click on the email link I get to verify), the callbackUrl value is ignored and it always go to the home page. But the initial behavior when calling sign in does work as expected. Unsure why you are seeing it change pages like you are, but that is the opposite of what I am seeing at that stage.

@identiq
Copy link

identiq commented Dec 9, 2021

#3226

@canastro
Copy link

canastro commented Feb 9, 2023

I'm having the same issue with @auth/sveltekit. Is there any workaround for sveltekit projects?

@ThangHuuVu
Copy link
Member

I can't reproduce this issue with v4, so I'm closing it. If anyone is still having the issue, feel free to open another one with a reproduction 🙏

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
None yet
Development

No branches or pull requests

5 participants