fix: tighten password and surface persistence errors

This commit is contained in:
Your Name
2026-05-28 20:38:34 +08:00
parent caad1aba0c
commit 9cc5892565
7 changed files with 228 additions and 11 deletions

View File

@@ -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("密码强度不足")
}