summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-07-08 09:17:14 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-07-08 09:17:14 -0400
commit2e513c8fd4c6b1b428b83044c017836b0011d32b (patch)
treedd583a99198c089ec09fa7bb124f2579bc7c88c0 /api
parent59d5ae40abb7e2fc5c43f3079454cacf12703b98 (diff)
downloadchat-2e513c8fd4c6b1b428b83044c017836b0011d32b.tar.gz
chat-2e513c8fd4c6b1b428b83044c017836b0011d32b.tar.bz2
chat-2e513c8fd4c6b1b428b83044c017836b0011d32b.zip
Login error messages fix (#3525)
Diffstat (limited to 'api')
-rw-r--r--api/user.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/api/user.go b/api/user.go
index daaa3a577..84906eece 100644
--- a/api/user.go
+++ b/api/user.go
@@ -449,8 +449,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
if result := <-Srv.Store.User().Get(id); result.Err != nil {
c.LogAuditWithUserId(user.Id, "failure")
- c.Err = result.Err
- c.Err.StatusCode = http.StatusBadRequest
+ //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error())
+ c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
return
} else {
user = result.Data.(*model.User)
@@ -460,7 +460,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
if user, err = getUserForLogin(loginId, ldapOnly); err != nil {
c.LogAudit("failure")
- c.Err = err
+ //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
+ c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
return
}
@@ -470,7 +471,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
// and then authenticate them
if user, err = authenticateUser(user, password, mfaToken); err != nil {
c.LogAuditWithUserId(user.Id, "failure")
- c.Err = err
+ //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
+ c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
return
}