summaryrefslogtreecommitdiffstats
path: root/app/login.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-18 13:07:52 -0700
committerGitHub <noreply@github.com>2018-05-18 13:07:52 -0700
commitb2ad52376530c59bc40f443be2b2461f26935731 (patch)
tree3506e1cbd0f91c17924b3078235216c53ed615d7 /app/login.go
parent88a8703766c422d69d061854269b926c9d3ae4b1 (diff)
downloadchat-b2ad52376530c59bc40f443be2b2461f26935731.tar.gz
chat-b2ad52376530c59bc40f443be2b2461f26935731.tar.bz2
chat-b2ad52376530c59bc40f443be2b2461f26935731.zip
Fixing TE login. (#8826)
Diffstat (limited to 'app/login.go')
-rw-r--r--app/login.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/login.go b/app/login.go
index a07056c1e..3001e1f4d 100644
--- a/app/login.go
+++ b/app/login.go
@@ -67,9 +67,11 @@ func (a *App) GetUserForLogin(id, loginId string) (*model.User, *model.AppError)
return result.Data.(*model.User), nil
}
- // Try to get the user with LDAP
- if user, err := a.Ldap.GetUser(loginId); err == nil {
- return user, nil
+ // 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
+ }
}
return nil, model.NewAppError("GetUserForLogin", "store.sql_user.get_for_login.app_error", nil, "", http.StatusBadRequest)