summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-07-15 12:26:32 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-07-15 12:26:32 -0400
commitf7b3731b2b2767b0784e1f2e0ce723cae917c47a (patch)
treefd00d8da4bcbd671a9b1324dd500d133daf06e19 /api
parent942ae4c5278e0a3064ef08937063ec66a6a8e990 (diff)
parentab52700aaa76a5623de23cd0156f5dbd9a24e264 (diff)
downloadchat-f7b3731b2b2767b0784e1f2e0ce723cae917c47a.tar.gz
chat-f7b3731b2b2767b0784e1f2e0ce723cae917c47a.tar.bz2
chat-f7b3731b2b2767b0784e1f2e0ce723cae917c47a.zip
Merge branch 'release-3.2' into 'master'
Diffstat (limited to 'api')
-rw-r--r--api/user.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/api/user.go b/api/user.go
index 513c39b96..7d2eb85bf 100644
--- a/api/user.go
+++ b/api/user.go
@@ -455,8 +455,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)
@@ -466,8 +466,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
}
@@ -477,12 +476,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())
- if err.Id == "api.user.login.not_verified.app_error" {
- c.Err = err
- } else {
- c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
- }
+ c.Err = err
return
}