const connect = auth.createUserWithEmailAndPassword(email,pass).catch(function(error){
if(error.code === 'auth/weak-password'){
errmsg.style.display = 'block';
errmsg.style.opacity = '1';
errmsg.innerHTML= 'The password is too weak.';
}
With the default setting, the requirement for password is 6 characters (letter/number). Is there a way to change this (Ex. require password to be letter-number combined)>
Firebase Authentication uses an internally modified version of scrypt to hash account passwords. Even when an account is uploaded with a password using a different algorithm, Firebase Auth will rehash the password the first time that account successfully logs in.
length: Firebase requires the passwords to be at least 6 characters, so it's a good idea to enforce it here instead of failing later in a less user-friendly way.
You don't need to store the password in the firebase database, after you authenticate the user using createUserWithEmailAndPassword the email and other info will be stored in the authentication console. So you do not need the password in the database, all you need is the userid to connect auth with database.
Enable Email/Password sign-in: In the Firebase console, open the Auth section. On the Sign in method tab, enable the Email/password sign-in method and click Save.
The password strength of Firebase Authentication's email+password authentication is not configurable. If you want full control over the requirements, you can consider implementing your own provider on top of Firebase Authentication.
Also see:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With