From a7299d9d855caf11d8bb0bab1b1b5e0fb19d9476 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 1 Dec 2020 10:43:13 +0100 Subject: [PATCH] Fix 401 error in embeds --- client/src/standalone/videos/embed.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 115d37ced..48f7e7749 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -125,10 +125,9 @@ export class PeerTubeEmbed { this.setHeadersFromTokens() resolve() + }).catch((refreshTokenError: any) => { + reject(refreshTokenError) }) - .catch((refreshTokenError: any) => { - reject(refreshTokenError) - }) }) return refreshingTokenPromise @@ -339,7 +338,7 @@ export class PeerTubeEmbed { try { playlistResponse = await playlistPromise - isResponseOk = true + isResponseOk = playlistResponse.status === 200 } catch (err) { console.error(err) isResponseOk = false @@ -368,7 +367,7 @@ export class PeerTubeEmbed { try { videoResponse = await videoPromise - isResponseOk = true + isResponseOk = videoResponse.status === 200 } catch (err) { console.error(err)