diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
commit | eec63bbc0f4fdb39e56f37127b35c449f90a135f (patch) | |
tree | 2403f5efea3e281698ae4a6b550fea9dfc52e390 /server/middlewares/oauth.ts | |
parent | c5d31dba56d669c0df0209761c43c5a6ac7cec4a (diff) | |
download | PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.gz PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.zst PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.zip |
Improve check follow params tests
Diffstat (limited to 'server/middlewares/oauth.ts')
-rw-r--r-- | server/middlewares/oauth.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts index e59168ea8..12872c4a5 100644 --- a/server/middlewares/oauth.ts +++ b/server/middlewares/oauth.ts | |||
@@ -17,7 +17,11 @@ function authenticate (req: express.Request, res: express.Response, next: expres | |||
17 | return res.sendStatus(500) | 17 | return res.sendStatus(500) |
18 | } | 18 | } |
19 | 19 | ||
20 | if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) return res.end() | 20 | if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) { |
21 | return res.json({ | ||
22 | error: 'Authentication failed.' | ||
23 | }).end() | ||
24 | } | ||
21 | 25 | ||
22 | return next() | 26 | return next() |
23 | }) | 27 | }) |