You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I return null, the caller always get CallbackRouteError error
I already found the issue, but need you guys to fix it.
in your code auth/core/src/lib/actions/callback/index.ts you throw CredentialsSignin() which extends Error. However in the logic of catch of this error, you will wrapper any error which doesn't extends AuthError with CallbackRouteError. I think you need to fix it to extends AuthError. I paste some picture of this code below
How to reproduce
Actually I found this issue in the official tutorial project - next.js dashboard
Just login with any email & password, it always return the same error. This is because I can't get the accurate error type from your auth SDK.
Expected behavior
Make the error correct & accurate
The text was updated successfully, but these errors were encountered:
TUTUBIG
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Jun 13, 2024
TUTUBIG
changed the title
next.js sdk can't get the correct error type of credentials provider
Simple Mistake - Easy FIX next.js sdk can't get the correct error type of credentials provider
Jun 13, 2024
Yeah thanks, so the idea was actually to provide another error class to extend for custom credentialErrors that doesnt extend AuthError, because that would end up with our messaging appended to the error.messgae, which users didn't want.
Looks like we just have to also not wrap that one here. I'll take a look shortly
I have check the latest version code "next-auth": "^5.0.0-beta.20", the error is still here , althougth you team have create a new cutomised class SignInError to let CredentialsSignin inherited , and also here are my solutions ,and help your team can check and help resolved, #11684
Environment
Reproduction URL
https://github.com/TUTUBIG/nextJs-dashboard
Describe the issue
when I return null, the caller always get CallbackRouteError errorI already found the issue, but need you guys to fix it.
in your code
auth/core/src/lib/actions/callback/index.ts
you throwCredentialsSignin()
which extendsError
. However in the logic of catch of this error, you will wrapper any error which doesn't extendsAuthError
withCallbackRouteError
. I think you need to fix it to extendsAuthError
. I paste some picture of this code belowHow to reproduce
Actually I found this issue in the official tutorial project - next.js dashboard
Just login with any email & password, it always return the same error. This is because I can't get the accurate error type from your auth SDK.
Expected behavior
Make the error correct & accurate
The text was updated successfully, but these errors were encountered: