aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/oauth.ts
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2020-12-04 22:13:11 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-08 10:40:08 +0100
commit2805cb7cb68cae0f25bd43f166e4a6b8501d41eb (patch)
treee80b70812787359aef59adc37fd546f992f2093e /server/middlewares/oauth.ts
parentf17faefb30e4872688a1c0dafcc6c793242750f4 (diff)
downloadPeerTube-2805cb7cb68cae0f25bd43f166e4a6b8501d41eb.tar.gz
PeerTube-2805cb7cb68cae0f25bd43f166e4a6b8501d41eb.tar.zst
PeerTube-2805cb7cb68cae0f25bd43f166e4a6b8501d41eb.zip
server/mw/oauth: res.loc.auth to true upon auth
Setting res.locals.authenticated explicity to true makes it's more clear whether the req is authenticated when using optionalAuthenticate middlware.
Diffstat (limited to 'server/middlewares/oauth.ts')
-rw-r--r--server/middlewares/oauth.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts
index ab5301415..ffc1b7ca9 100644
--- a/server/middlewares/oauth.ts
+++ b/server/middlewares/oauth.ts
@@ -20,6 +20,8 @@ function authenticate (req: express.Request, res: express.Response, next: expres
20 .end() 20 .end()
21 } 21 }
22 22
23 res.locals.authenticated = true
24
23 return next() 25 return next()
24 }) 26 })
25} 27}