Open TUTUBIG opened 3 months ago
The types are broken in #11050
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, https://github.com/nextauthjs/next-auth/discussions/11684
Environment
Reproduction URL
https://github.com/TUTUBIG/nextJs-dashboard
Describe the issue
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 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