feat: fix MFA + LDAP bug in /check-user-password API (#3681)

This commit is contained in:
WindSpiritSR 2025-03-26 22:11:58 +08:00 committed by GitHub
parent 4bee21f4a3
commit 08f7a05e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -602,7 +602,11 @@ func (c *ApiController) CheckUserPassword() {
return
}
_, err = object.CheckUserPassword(user.Owner, user.Name, user.Password, c.GetAcceptLanguage())
/*
* Verified password with user as subject, if field ldap not empty,
* then `isPasswordWithLdapEnabled` is true
*/
_, err = object.CheckUserPassword(user.Owner, user.Name, user.Password, c.GetAcceptLanguage(), false, false, user.Ldap != "")
if err != nil {
c.ResponseError(err.Error())
} else {