mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: Users added through LDAP cannot log in using the set password (#3175)
* fix: login will prioritize the use of password set in casdoor and use ldap when use LDAP option in login form or user never change their password in casdoor after sync * fix: promote if statement
This commit is contained in:
parent
05bfd3a3a3
commit
973a1df6c2
@ -354,8 +354,8 @@ func CheckUserPassword(organization string, username string, password string, la
|
||||
}
|
||||
}
|
||||
|
||||
if user.Ldap != "" {
|
||||
if !isSigninViaLdap && !isPasswordWithLdapEnabled {
|
||||
if user.Ldap != "" && (isSigninViaLdap || user.Password == "") {
|
||||
if !isPasswordWithLdapEnabled {
|
||||
return nil, fmt.Errorf(i18n.Translate(lang, "check:password or code is incorrect"))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user