aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/oauth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/oauth.ts')
-rw-r--r--server/middlewares/oauth.ts6
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 })