diff options
author | Chocobozzz <me@florianbigard.com> | 2022-12-20 09:15:49 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-12-20 09:15:49 +0100 |
commit | 868314e8bf6bcc325b0fea35887071ef0614a46d (patch) | |
tree | 2f46353e3a44ed6db3068d1d1e4f3b472fdd3869 /server/tests/fixtures | |
parent | 93293ca7887e34fd9b6413fdaeea3d1dddc46ece (diff) | |
download | PeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.tar.gz PeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.tar.zst PeerTube-868314e8bf6bcc325b0fea35887071ef0614a46d.zip |
Add ability to get user from file token
Diffstat (limited to 'server/tests/fixtures')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 19dccf26e..19ba9f278 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -250,7 +250,10 @@ async function register ({ registerHook, registerSetting, settingsManager, stora | |||
250 | 250 | ||
251 | registerHook({ | 251 | registerHook({ |
252 | target: 'filter:api.download.video.allowed.result', | 252 | target: 'filter:api.download.video.allowed.result', |
253 | handler: (result, params) => { | 253 | handler: async (result, params) => { |
254 | const loggedInUser = await peertubeHelpers.user.getAuthUser(params.res) | ||
255 | if (loggedInUser) return { allowed: true } | ||
256 | |||
254 | if (params && !params.streamingPlaylist && params.video.name.includes('bad file')) { | 257 | if (params && !params.streamingPlaylist && params.video.name.includes('bad file')) { |
255 | return { allowed: false, errorMessage: 'Cao Cao' } | 258 | return { allowed: false, errorMessage: 'Cao Cao' } |
256 | } | 259 | } |