mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-10 06:22:56 +08:00
feat: check empty password in CheckPassword()
This commit is contained in:
@@ -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"))
|
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
|
passwordType := user.PasswordType
|
||||||
if passwordType == "" {
|
if passwordType == "" {
|
||||||
passwordType = organization.PasswordType
|
passwordType = organization.PasswordType
|
||||||
|
Reference in New Issue
Block a user