Revert "Login error messages fix (#3525)"

This reverts commit 2e513c8fd4.
Этот коммит содержится в:
Christopher Speller
2016-07-12 15:18:25 -04:00
родитель 7c8654171e
Коммит 4775631ed4

Просмотреть файл

@@ -449,8 +449,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
if result := <-Srv.Store.User().Get(id); result.Err != nil { if result := <-Srv.Store.User().Get(id); result.Err != nil {
c.LogAuditWithUserId(user.Id, "failure") c.LogAuditWithUserId(user.Id, "failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error()) c.Err = result.Err
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") c.Err.StatusCode = http.StatusBadRequest
return return
} else { } else {
user = result.Data.(*model.User) 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 { if user, err = getUserForLogin(loginId, ldapOnly); err != nil {
c.LogAudit("failure") c.LogAudit("failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) c.Err = err
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
return return
} }
@@ -471,8 +470,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
// and then authenticate them // and then authenticate them
if user, err = authenticateUser(user, password, mfaToken); err != nil { if user, err = authenticateUser(user, password, mfaToken); err != nil {
c.LogAuditWithUserId(user.Id, "failure") c.LogAuditWithUserId(user.Id, "failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) c.Err = err
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
return return
} }