aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-helpers-builder.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-20 09:15:49 +0100
committerChocobozzz <me@florianbigard.com>2022-12-20 09:15:49 +0100
commit868314e8bf6bcc325b0fea35887071ef0614a46d (patch)
tree2f46353e3a44ed6db3068d1d1e4f3b472fdd3869 /server/lib/plugins/plugin-helpers-builder.ts
parent93293ca7887e34fd9b6413fdaeea3d1dddc46ece (diff)
downloadPeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.tar.gz
PeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.tar.zst
PeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.zip
Add ability to get user from file token
Diffstat (limited to 'server/lib/plugins/plugin-helpers-builder.ts')
-rw-r--r--server/lib/plugins/plugin-helpers-builder.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.ts
index 7b1def6e3..e75c0b994 100644
--- a/server/lib/plugins/plugin-helpers-builder.ts
+++ b/server/lib/plugins/plugin-helpers-builder.ts
@@ -245,7 +245,7 @@ function buildUserHelpers () {
245 }, 245 },
246 246
247 getAuthUser: (res: express.Response) => { 247 getAuthUser: (res: express.Response) => {
248 const user = res.locals.oauth?.token?.User 248 const user = res.locals.oauth?.token?.User || res.locals.videoFileToken?.user
249 if (!user) return undefined 249 if (!user) return undefined
250 250
251 return UserModel.loadByIdFull(user.id) 251 return UserModel.loadByIdFull(user.id)