signInWithPassword with flutter throwing AuthException with code = null contrary to documentation

I'm currently facing the problem that signInWithPassword is throwing AuthException not according to what is documented at https://supabase.com/docs/guides/auth/debugging/error-codes For example in case of invalid credentials I get code = null and statusCode = 400. Therefore the behavior of signInWithPassword is unpredictable for me and i can't safely catch all cases. I'm using supabase_flutter 2.9.1 and flutter 3.32.8
No description
7 Replies
Guybrush Threepwood
In adidtion to the URL (not exisitng) of the documentation of AuthException.code seems outdated:
/// Error code associated with the error. Most errors coming from
/// HTTP responses will have a code, though some errors that occur
/// before a response is received will not have one present.
/// In that case [statusCode] will also be null.
///
/// Find the full list of error codes in our documentation.
/// https://supabase.com/docs/reference/dart/auth-error-codes
final String? code;
/// Error code associated with the error. Most errors coming from
/// HTTP responses will have a code, though some errors that occur
/// before a response is received will not have one present.
/// In that case [statusCode] will also be null.
///
/// Find the full list of error codes in our documentation.
/// https://supabase.com/docs/reference/dart/auth-error-codes
final String? code;
Also filed a GitHub issue
Guybrush Threepwood
GitHub
signInWithPassword throwing AuthException with code=null contrary t...
I'm currently facing the problem that signInWithPassword is throwing AuthException not according to what is documented at https://supabase.com/docs/guides/auth/debugging/error-codes For example...
garyaustin
garyaustin4mo ago
Looks like it is something in the Flutter Client... The Supabase-js client returns:
No description
Guybrush Threepwood
I think so as well, that‘s why I opened an issue in supabase_flutter Ok i found out that this is happening only with the self hosted version of supabase.
garyaustin
garyaustin4mo ago
Are you on the latest version?
Guybrush Threepwood
I'm on the latest i can get via brew but let me check when i'm home
garyaustin
garyaustin4mo ago
I'm going to bow out. I don't do self-hosting and if it is not there then you will likely need to generate an issue for Supabase to resolve if the auth version is different. I don't think though this has changed in many months or longer.

Did you find this page helpful?