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

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

parent 517faccc
......@@ -116,9 +116,12 @@ 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 {
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
}
}
return nil, model.NewAppError("GetUserForLogin", "store.sql_user.get_for_login.app_error", nil, "", http.StatusBadRequest)
......
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