有没有办法为Firebase设置密码强度? [英] Is there a way to set a password strength for Firebase?

查看:101
本文介绍了有没有办法为Firebase设置密码强度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 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.';
      }

在默认设置下,密码要求为6个字符(字母/数字).有没有办法更改此密码(例如,要求密码为字母数字组合)>

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身份验证的电子邮件+密码身份验证的密码强度不可配置.如果您想完全控制这些要求,可以考虑在Firebase身份验证.

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.

另请参阅:

  • Set Minimum Password Length Firebase Email & Password Authentication
  • Enforce custom rules for passwords for Firebase Auth accounts
  • Firebase Password Validation allowed regex
  • Password Requirements when making an account with firrebase

这篇关于有没有办法为Firebase设置密码强度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆