summaryrefslogtreecommitdiffstats
path: root/app/login.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/login.go')
-rw-r--r--app/login.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/login.go b/app/login.go
index 5099a3e7a..01cdde386 100644
--- a/app/login.go
+++ b/app/login.go
@@ -96,17 +96,16 @@ func (a *App) GetUserForLogin(id, loginId string) (*model.User, *model.AppError)
// If we are given a userID then fail if we can't find a user with that ID
if len(id) != 0 {
- if user, err := a.GetUser(id); err != nil {
+ user, err := a.GetUser(id)
+ if err != nil {
if err.Id != store.MISSING_ACCOUNT_ERROR {
err.StatusCode = http.StatusInternalServerError
return nil, err
- } else {
- err.StatusCode = http.StatusBadRequest
- return nil, err
}
- } else {
- return user, nil
+ err.StatusCode = http.StatusBadRequest
+ return nil, err
}
+ return user, nil
}
// Try to get the user by username/email
@@ -200,7 +199,6 @@ func (a *App) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User,
func GetProtocol(r *http.Request) string {
if r.Header.Get(model.HEADER_FORWARDED_PROTO) == "https" || r.TLS != nil {
return "https"
- } else {
- return "http"
}
+ return "http"
}