diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/login.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/login.go b/app/login.go index 4897ae171..5099a3e7a 100644 --- a/app/login.go +++ b/app/login.go @@ -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 } } |