From 49e7e4d9ffd16cba7a721f6d3d3203decf4f4b2c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Oct 2022 14:28:38 +0200 Subject: Fix token injection if unlogged user --- client/src/assets/player/shared/peertube/peertube-plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/assets/player/shared') diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts index 4bd038bb1..56de66998 100644 --- a/client/src/assets/player/shared/peertube/peertube-plugin.ts +++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts @@ -210,7 +210,7 @@ class PeerTubePlugin extends Plugin { lastViewEvent = undefined // Server won't save history, so save the video position in local storage - if (!this.authorizationHeader) { + if (!this.authorizationHeader()) { saveVideoWatchHistory(this.videoUUID, currentTime) } }, this.CONSTANTS.USER_VIEW_VIDEO_INTERVAL) @@ -228,7 +228,7 @@ class PeerTubePlugin extends Plugin { 'Content-type': 'application/json; charset=UTF-8' }) - if (this.authorizationHeader) headers.set('Authorization', this.authorizationHeader()) + if (this.authorizationHeader()) headers.set('Authorization', this.authorizationHeader()) return fetch(this.videoViewUrl, { method: 'POST', body: JSON.stringify(body), headers }) } -- cgit v1.2.3