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")) }