mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 14:49:01 +02:00
send 401 when login fails
This commit is contained in:
@@ -32,7 +32,7 @@ module.exports = AuthenticationController =
|
||||
else
|
||||
AuthenticationController._recordFailedLogin()
|
||||
logger.log email: email, "failed log in"
|
||||
res.send message:
|
||||
res.send 401, message:
|
||||
text: req.i18n.translate("email_or_password_wrong_try_again"),
|
||||
type: 'error'
|
||||
|
||||
|
||||
+3
-4
@@ -96,11 +96,10 @@ describe "AuthenticationController", ->
|
||||
@AuthenticationController.login(@req, @res)
|
||||
|
||||
it "should return an error", ->
|
||||
# @res.body.should.exist
|
||||
expect(@res.body.message).to.exist
|
||||
# message:
|
||||
# text: 'Your email or password were incorrect. Please try again',
|
||||
# type: 'error'
|
||||
|
||||
it "should set the res code to 401", ->
|
||||
@res.statusCode.should.equal 401
|
||||
|
||||
it "should not establish a session", ->
|
||||
@AuthenticationController._establishUserSession.called.should.equal false
|
||||
|
||||
Reference in New Issue
Block a user