]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/oauth.js
Merge branch 'master' into webseed-merged
[github/Chocobozzz/PeerTube.git] / server / middlewares / oauth.js
index 91a99050913eead153e1c281bd5b86c524fc5993..3a02b9b4863c1e16b06502ae781368f13a48b7cb 100644 (file)
@@ -12,8 +12,8 @@ const oAuthServer = new OAuthServer({
 })
 
 const oAuth = {
-  authenticate: authenticate,
-  token: token
+  authenticate,
+  token
 }
 
 function authenticate (req, res, next) {
@@ -23,7 +23,7 @@ function authenticate (req, res, next) {
       return res.sendStatus(500)
     }
 
-    if (res.statusCode === 401 || res.statusCode === 400) return res.end()
+    if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) return res.end()
 
     return next()
   })