-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
signIn()
error/cancel ends up in api/auth/signin?error=Callback#_=_
#7753
Comments
Same thing happens when using Duende IdentityServer. Actually we can override signin page using pages configuration.. |
No, it never reach any of the page configured at all! |
Try using this guide #3154 I just tested it, and it works for me. I use the following versions: "next": "13.4.4" app/api/auth/[...nextauth]/route.ts
app/auth/signin/page.tsx
When calling If you want to reach your custom login page before redirecting to the identity provider, you should call Hope it helps! 😃 However, I am unsure if this error can be handled at this time.
|
Reopen this because the other application doesn't work with this solution. It ends up in
This lets me think that the case which works is because Any idea what could be the root cause here? Thanks. |
I don't have an idea, but maybe this somehow helps... According to the documentation:
Since you didn't successfully log in (cancel), the Identity Provider returns an error to the only URL it is aware of, which is the login page (/auth/signin) but not signin_callback_url configured in Identity Provider. However, you can manually navigate to any path you want from /auth/signin page. It seems like the returned error does not considered as a redirect. |
It's due to the missing input param
|
For me still not clear how can I make a proper handle of this kind of errors. [next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] and then my application is just being redirected to /auth/signin?error=Callback |
I have a similar situation as @arielconti10 where I need to capture an error message returned by the provider and show the message to the user. The error=Callback is not enough. @arielconti10 have you figured out any alternative? |
@rahul-reveation not at all, I've just handled it as a generic error |
Ok..that would not cut for us. We need to show the specific error. |
@rahul-reveation did you find a solution for this? I am currently trying to solve this issue as well using next-auth 4.24.10 |
Honestly, it's been more than one year and I don't remember if we ever found the solution |
Me neither, I've bypassed it somehow but honestly I don't remember |
Environment
System:
OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
Memory: 46.05 GB / 62.45 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 19.8.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.5.1 - /usr/local/bin/npm
Browsers:
Chrome: 114.0.5735.106
Firefox: 113.0.2
Reproduction URL
https://github.com/nextauthjs/next-auth-example
Describe the issue
How to properly handle errors on
signin()
? For example, cancelling the signIn operation from the provider should redirect back to the login or home page instead of ending up atapi/auth/signin?error=Callback#_=_
How to reproduce
Launch https://github.com/nextauthjs/next-auth-example and then cancel the signin or provide invalid credentials. How to properly handle signin error so that it could redirect to proper page?
Expected behavior
Being able to properly redirect the user to the home page when user cancels the sign in.
The text was updated successfully, but these errors were encountered: