Closed peterkos closed 2 weeks ago
It looks like this is also here: https://github.com/supabase/auth/issues/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
: https://github.com/supabase/auth-js/blob/29fc62ce2da7ca60504d2513012fd3bb2820e632/src/lib/errors.ts#L78-L82To 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