mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +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"
|
return nil, "the user is forbidden to sign in, please contact the administrator"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if user.Ldap != "" {
|
||||||
|
//ONLY for ldap users
|
||||||
|
return checkLdapUserPassword(user, password)
|
||||||
|
} else {
|
||||||
msg := CheckPassword(user, password)
|
msg := CheckPassword(user, password)
|
||||||
if msg != "" {
|
if msg != "" {
|
||||||
//for ldap users
|
|
||||||
if user.Ldap != "" {
|
|
||||||
return checkLdapUserPassword(user, password)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, msg
|
return nil, msg
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return user, ""
|
return user, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user