aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/oauth.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-17 10:55:40 +0200
committerChocobozzz <me@florianbigard.com>2020-06-17 11:42:50 +0200
commitfaa9d434b4d681837ff2a87603337c2623419669 (patch)
tree1f3c798dd6fd5f2dcbb019978f063f448c019974 /server/middlewares/oauth.ts
parent982f2fc9b42537ca40ff29bf62c1ca3692d4b587 (diff)
downloadPeerTube-faa9d434b4d681837ff2a87603337c2623419669.tar.gz
PeerTube-faa9d434b4d681837ff2a87603337c2623419669.tar.zst
PeerTube-faa9d434b4d681837ff2a87603337c2623419669.zip
Update server dependencies
Diffstat (limited to 'server/middlewares/oauth.ts')
-rw-r--r--server/middlewares/oauth.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts
index 9d0eaa51f..b1149174b 100644
--- a/server/middlewares/oauth.ts
+++ b/server/middlewares/oauth.ts
@@ -48,7 +48,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
48function authenticatePromiseIfNeeded (req: express.Request, res: express.Response, authenticateInQuery = false) { 48function authenticatePromiseIfNeeded (req: express.Request, res: express.Response, authenticateInQuery = false) {
49 return new Promise(resolve => { 49 return new Promise(resolve => {
50 // Already authenticated? (or tried to) 50 // Already authenticated? (or tried to)
51 if (res.locals.oauth && res.locals.oauth.token.User) return resolve() 51 if (res.locals.oauth?.token.User) return resolve()
52 52
53 if (res.locals.authenticated === false) return res.sendStatus(401) 53 if (res.locals.authenticated === false) return res.sendStatus(401)
54 54