fix: tighten password and surface persistence errors
This commit is contained in:
@@ -306,6 +306,10 @@ func validatePasswordStrength(password string, minLength int, strict bool) error
|
||||
return nil
|
||||
}
|
||||
|
||||
if info.Length <= minLength && info.Score < 3 {
|
||||
return errors.New("密码强度不足,短密码需至少包含三种字符类型")
|
||||
}
|
||||
|
||||
if info.Score < 2 {
|
||||
return errors.New("密码强度不足")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user