From 66ba6e612d008b97576bf95e9436f288088ab677 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 8 Aug 2014 10:21:17 +0100 Subject: [PATCH] Revert "send 401 when login fails" This reverts commit fb901c6365d37654ba9058f57a71a4e60366688e. --- .../Authentication/AuthenticationController.coffee | 2 +- .../Authentication/AuthenticationControllerTests.coffee | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee index 3f8ed41637..bb323ce052 100644 --- a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee +++ b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee @@ -32,7 +32,7 @@ module.exports = AuthenticationController = else AuthenticationController._recordFailedLogin() logger.log email: email, "failed log in" - res.send 401, message: + res.send message: text: req.i18n.translate("email_or_password_wrong_try_again"), type: 'error' diff --git a/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee b/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee index dd3a207006..f6d55d2a4a 100644 --- a/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee @@ -96,10 +96,11 @@ describe "AuthenticationController", -> @AuthenticationController.login(@req, @res) it "should return an error", -> + # @res.body.should.exist expect(@res.body.message).to.exist - - it "should set the res code to 401", -> - @res.statusCode.should.equal 401 + # message: + # text: 'Your email or password were incorrect. Please try again', + # type: 'error' it "should not establish a session", -> @AuthenticationController._establishUserSession.called.should.equal false