feat: check empty password in CheckPassword()

This commit is contained in:
hsluoyz 2025-01-28 21:13:59 +08:00
parent 5a78dcf06d
commit bad21fb6bb

View File

@ -241,6 +241,10 @@ func CheckPassword(user *User, password string, lang string, options ...bool) er
return fmt.Errorf(i18n.Translate(lang, "check:Organization does not exist"))
}
if password == "" {
return fmt.Errorf(i18n.Translate(lang, "check:Password cannot be empty"))
}
passwordType := user.PasswordType
if passwordType == "" {
passwordType = organization.PasswordType