diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-07-12 15:18:25 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-07-12 15:18:25 -0400 |
commit | 4775631ed4ef679d1b25a75e5f345aa5fbfabe80 (patch) | |
tree | 6cbfd94cff6ac41c11e092e67306687f1ed2fa9c /api | |
parent | 7c8654171e893d827fcfdbe7864ab1712888b46a (diff) | |
download | chat-4775631ed4ef679d1b25a75e5f345aa5fbfabe80.tar.gz chat-4775631ed4ef679d1b25a75e5f345aa5fbfabe80.tar.bz2 chat-4775631ed4ef679d1b25a75e5f345aa5fbfabe80.zip |
Revert "Login error messages fix (#3525)"
This reverts commit 2e513c8fd4c6b1b428b83044c017836b0011d32b.
Diffstat (limited to 'api')
-rw-r--r-- | api/user.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/api/user.go b/api/user.go index 6ed2939d1..a3c2faf6a 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 = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = result.Err + c.Err.StatusCode = http.StatusBadRequest return } else { user = result.Data.(*model.User) @@ -460,8 +460,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { if user, err = getUserForLogin(loginId, ldapOnly); err != nil { c.LogAudit("failure") - //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = err return } @@ -471,8 +470,7 @@ 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 = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = err return } |