-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
AuthApiError "Invalid login credentials" has undefined code
#937
Comments
code
code
It looks like this is also here: supabase/auth#1631 I figured this issue was JS-specific, but it appears not? |
My workaround: if (isAuthApiError(error)) {
if (error.code == 'user_not_found') {
throw new UnauthorizedException();
} else {
throw new UnauthorizedException(`${error}`);
}
} else if (error) {
throw new InternalServerErrorException(
`Unhandled unknown error: ${error}`,
);
} |
Hey, Thanks for flagging the issue. A fix has been merged and this should be patched later this week or early next week with our next deploy Hope this helps. I'm going to close for now but feel free to re-open or head to #804 if there are any issues after upgrading. You can track the version under Settings > Infrastructure > Service Versions > Auth version. Should be good to go once your project version is v2.159.0 or later |
Bug report
Describe the bug
When attempting to login a user with invalid credentials, the returned error is missing a code:
Output:
The source of
AuthAPIError
has code asundefined
:auth-js/src/lib/errors.ts
Lines 78 to 82 in 29fc62c
To Reproduce
supabase.auth.signInWithPassword({ /* ... */ })
with incorrect credentialserror.code
isundefined
Expected behavior
Per docs:
code
should be defined for anAuthApiError
.Screenshots
If applicable, add screenshots to help explain your problem.
System information
The text was updated successfully, but these errors were encountered: