Improve check follow params tests

This commit is contained in:
Chocobozzz 2017-12-28 14:29:57 +01:00
parent c5d31dba56
commit eec63bbc0f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
21 changed files with 232 additions and 150 deletions

View file

@ -17,7 +17,11 @@ function authenticate (req: express.Request, res: express.Response, next: expres
return res.sendStatus(500)
}
if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) return res.end()
if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) {
return res.json({
error: 'Authentication failed.'
}).end()
}
return next()
})