TokenStore migration to return plain errors (#14875)

* TokenStore migration to return plain errors

* Fix translations

* Fix: returned error is ignored and http.StatusBadRequest is always returned

* Fix

* Fix translations

* Suggestions

* Changed from BadRequest to NotFound

* Setting the correct http status

* Changed test to expect 404 status

* Fix error
Этот коммит содержится в:
Rodrigo Villablanca
2020-07-09 03:16:27 -04:00
коммит произвёл GitHub
родитель 4df6019f61
Коммит 8b6a5fc5d7
14 изменённых файлов: 101 добавлений и 86 удалений

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

@@ -256,7 +256,7 @@ func TestCreateUserWithToken(t *testing.T) {
user := model.User{Email: th.GenerateTestEmail(), Nickname: "Corey Hulen", Password: "hello1", Username: GenerateTestUsername(), Roles: model.SYSTEM_ADMIN_ROLE_ID + " " + model.SYSTEM_USER_ROLE_ID}
_, resp := th.Client.CreateUserWithToken(&user, "wrong")
CheckBadRequestStatus(t, resp)
CheckNotFoundStatus(t, resp)
CheckErrorMessage(t, resp, "api.user.create_user.signup_link_invalid.app_error")
})