Commit 7226ea7d authored by Jesús Espino's avatar Jesús Espino Committed by Elias Nahum

MM-12045: Fix MFA for ldap accounts (#9420)

parent 517faccc
......@@ -116,8 +116,11 @@ func (a *App) GetUserForLogin(id, loginId string) (*model.User, *model.AppError)
// Try to get the user with LDAP if enabled
if *a.Config().LdapSettings.Enable && a.Ldap != nil {
if user, err := a.Ldap.GetUser(loginId); err == nil {
return user, nil
if ldapUser, err := a.Ldap.GetUser(loginId); err == nil {
if user, err := a.GetUserByAuth(ldapUser.AuthData, model.USER_AUTH_SERVICE_LDAP); err == nil {
return user, nil
}
return ldapUser, nil
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment