mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +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:
parent
879ca6a488
commit
e3f5bf93b2
@ -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, ""
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user