Skip to content

Instantly share code, notes, and snippets.

@wizlif
Last active October 17, 2023 19:12
Show Gist options
  • Save wizlif/16ae686441765ce6bd28bc1b4b6e941d to your computer and use it in GitHub Desktop.
Save wizlif/16ae686441765ce6bd28bc1b4b6e941d to your computer and use it in GitHub Desktop.
Firebase Auth Exception Codes

Future confirmPasswordReset(String code, String newPassword)

A [FirebaseAuthException] maybe thrown with the following error code:

  • expired-action-code: - Thrown if the action code has expired.
  • invalid-action-code: - Thrown if the action code is invalid. This can happen if the code is malformed or has already been used.
  • user-disabled: - Thrown if the user corresponding to the given action code has been disabled.
  • user-not-found: - Thrown if there is no user corresponding to the action code. This may have happened if the user was deleted between when the action code was issued and when this method was called.
  • weak-password: - Thrown if the new password is not strong enough.

Future createUserWithEmailAndPassword( String email, String password,)

A [FirebaseAuthException] maybe thrown with the following error code:

  • email-already-in-use: - Thrown if there already exists an account with the given email address.
  • invalid-email: - Thrown if the email address is not valid.
  • operation-not-allowed: - Thrown if email/password accounts are not enabled. Enable email/password accounts in the Firebase Console, under the Auth tab.
  • weak-password: - Thrown if the password is not strong enough.

Future signInAnonymously()

A [FirebaseAuthException] maybe thrown with the following error code:

  • operation-not-allowed: - Thrown if anonymous accounts are not enabled. Enable anonymous accounts in the Firebase Console, under the Auth tab.

Future signInWithCredential(AuthCredential credential,)

A [FirebaseAuthException] maybe thrown with the following error code:

  • account-exists-with-different-credential: - Thrown if there already exists an account with the email address asserted by the credential. Resolve this by calling [fetchSignInMethodsForEmail] and then asking the user to sign in using one of the returned providers. Once the user is signed in, the original credential can be linked to the user with [linkWithCredential].
  • invalid-credential: - Thrown if the credential is malformed or has expired.
  • operation-not-allowed: - 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.
  • user-disabled: - Thrown if the user corresponding to the given credential has been disabled.
  • user-not-found: - Thrown if signing in with a credential from [EmailAuthProvider.credential] and there is no user corresponding to the given email.
  • wrong-password: - Thrown if signing in with a credential from [EmailAuthProvider.credential] and the password is invalid for the given email, or if the account corresponding to the email does not have a password set.
  • invalid-verification-code: - Thrown if the credential is a [PhoneAuthProvider.credential] and the verification code of the credential is not valid.
  • invalid-verification-id: - Thrown if the credential is a [PhoneAuthProvider.credential] and the verification ID of the credential is not valid.id.

Future signInWithEmailAndPassword(String email,String password,)

A [FirebaseAuthException] maybe thrown with the following error code:

  • invalid-email: - Thrown if the email address is not valid.
  • user-disabled: - Thrown if the user corresponding to the given email has been disabled.
  • user-not-found: - Thrown if there is no user corresponding to the given email.
  • wrong-password: - Thrown if the password is invalid for the given email, or the account corresponding to the email does not have a password set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment