[firebase_auth] Exceptions thrown during multi-factor enrolling are not granular enough #9344
Unanswered
davidmigloz
asked this question in
Feature request
Replies: 1 comment
-
It seems to be fixed now:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When you enroll a new phone for 2fa:
or when you resolve the multi factor sign in:
If the SMS verification code is incorrect, the following exception is thrown:

FirebaseAuthInvalidCredentialsException
com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The sms verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.
If the SMS verification code is expired, the following exception is thrown:

FirebaseAuthInvalidCredentialsException
com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The sms code has expired. Please re-send the verification code to try again.
As you can see, the exception code is the same. So the only way to differentiate them is to check the message, which doesn't sound very robust.
Is is posible to have proper exception wrappers with a unique code?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions