-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
4.18.4 no longer respects signIn(..., {redirect: false})
#6001
Comments
Identified the issue, here is an experimental release to test out: #6004 (comment) |
I have the same issue, it started with the release of v 4.18.1. |
This should be fixed in |
Please open a new issue with a minimal reproduction. |
I'm still getting this in 4.18.7. Reverted to 4.18.0 and the issue is still there. |
I have the same problem with @auth/core 0.2.5 in SvelteKit, redirect: false is not working, response is undefined.
|
@nmicun I discovered the same behavior in sveltekit, but instead of removing error I opted for converting error to a boolean: I console logged the evaluated variables and discovered that if there is no error, error returns null that's why removing error in your case temporarily fixed the issue. |
I'm also using sveltekit, In my case I fixed it by doing
Just like @binaryme said, error is null when the signIn is successfull and it is a string when there is an error. So in this way, the returned object will have the error property and you could check what value it has. |
Environment
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
Memory: 24.48 GB / 31.32 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm
npmPackages:
next: 13.0.6 => 13.0.6
next-auth: 4.18.0 => 4.18.0
react: 18.2.0 => 18.2.0
Reproduction URL
https://stackblitz.com/edit/github-61ga3k-pvybxx?file=pages%2Findex.tsx,pages%2Fapi%2Fauth%2F[...nextauth].ts
Describe the issue
After upgrading from 4.18.0 to 4.18.4 I noticed that
signIn(..., {redirect: false})
is no longer respecting theredirect: false
option.In my app I have a
CredentialsProvider
and I issue a signIn request like this:In 4.18.0, after a successful login, it this would return:
But in 4.18.4 it returns:
How to reproduce
Create an example app with
[email protected]
and update thesignIn()
call in the header to use theredirect: false
option. Proceed to login and check the response of thesignIn()
request.Expected behavior
The
signIn()
call should resolve with anok: true
object upon successful login.The text was updated successfully, but these errors were encountered: