mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 01:50:20 +08:00
fix: adjust the password check logic for ldap user (#597)
* fix: the password check logic for ldap user. LDAP user should only use the ldap connection to check the password. * fix: code format
This commit is contained in:
@ -180,16 +180,15 @@ func CheckUserPassword(organization string, username string, password string) (*
|
||||
return nil, "the user is forbidden to sign in, please contact the administrator"
|
||||
}
|
||||
|
||||
msg := CheckPassword(user, password)
|
||||
if msg != "" {
|
||||
//for ldap users
|
||||
if user.Ldap != "" {
|
||||
return checkLdapUserPassword(user, password)
|
||||
if user.Ldap != "" {
|
||||
//ONLY for ldap users
|
||||
return checkLdapUserPassword(user, password)
|
||||
} else {
|
||||
msg := CheckPassword(user, password)
|
||||
if msg != "" {
|
||||
return nil, msg
|
||||
}
|
||||
|
||||
return nil, msg
|
||||
}
|
||||
|
||||
return user, ""
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user