From 973a1df6c279218342fa086d8d28c756f59fe372 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Fri, 6 Sep 2024 10:31:34 +0800 Subject: [PATCH] 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 --- object/check.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/object/check.go b/object/check.go index 5200cf1f..36defa0d 100644 --- a/object/check.go +++ b/object/check.go @@ -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")) }