javascriptfirebasefirebase-authentication

Password Requirements when making an account with Firebase


What are the requirements to avoid throwing the "auth/weak-password" error code on the firebase.auth().createUserWithEmailAndPassword(email, password).

I would like to show the user the requirements so they don't have to throw the error several times on the way to create an account.

I have checked the Firebase documentation:

And StackOverflow but have not found this info.


Solution

  • The only weakness test I'm aware of is length less than 6 characters:

    public final class FirebaseAuthWeakPasswordException extends FirebaseAuthInvalidCredentialsException

    Thrown when using a weak password (less than 6 chars) to create a new account or to update an existing account's password. Use getReason() to get a message with the reason the validation failed that you can display to your users.

    Excerpted from this documentation.