You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classFireBaseAuthErrorCode {
/// Thrown if there already exists an account with the email address asserted by the credential./// See: https://firebase.flutter.dev/docs/auth/error-handling/#handling-account-exists-with-different-credential-errorsstaticconst accountExistsWithDifferentCredential ='account-exists-with-different-credential';
/// Thrown if the SMS quota for the Firebase project has been exceeded.staticconst quotaExceeded ='quota-exceeded';
/// Thrown if the credential is malformed or has expired.staticconst invalidCredential ='invalid-credential';
/// Thrown if the type of account corresponding to the credential is not enabled./// Enable the account type in the Firebase Console, under the Auth tab.staticconst operationNotAllowed ='operation-not-allowed';
/// Thrown if the reCAPTCHA response token was invalid, expired, or if this method was called from a non-whitelisted domain.staticconst captchaCheckFailed ='captcha-check-failed';
staticconst missingPhoneNumber ='missing-phone-number';
staticconst invalidPhoneNumber ='invalid-phone-number';
staticconst missingVerificationCode ='missing-verification-code';
staticconst invalidVerificationCode ='invalid-verification-code';
staticconst missingVerificationId ='missing-verification-id';
staticconst invalidVerificationId ='invalid-verification-id';
staticconst codeExpired ='code-expired';
staticconst userDisabled ='user-disabled';
staticconst userNotFound ='user-not-found';
staticconst wrongPassword ='wrong-password';
}
At the moment error code stored as string and we even don't have exhaustive enum of possible errors.
It was not easy, but I found error codes list. Actually I found two:
https://cloud.google.com/identity-platform/docs/error-codes
https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signinwithcredential
So, I suggest this approach to error handling:
FireBaseAuthErrorCode
Now we can use it like this:
It should be a part of API.
@Salakar @russellwheatley @rrousselGit Please review it and I'll make a PR.
The text was updated successfully, but these errors were encountered: