X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fstandalone%2Fvideos%2Fembed.ts;h=4ce5c78e8b45a26aae24e7055cd8aae98306bc30;hb=e030bfb59dd5ee65f20a64686ec9b22ca39f70ae;hp=fc61d37303bc4b6cc94e27fce1d52f4c7fe1068d;hpb=819b656439e5f0ec2ae5de9357502cdfe3196197;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index fc61d3730..4ce5c78e8 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -5,6 +5,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c import { ClientHookName, HTMLServerConfig, + OAuth2ErrorCode, PluginType, ResultList, UserRefreshToken, @@ -118,8 +119,8 @@ export class PeerTubeEmbed { if (res.status === HttpStatusCode.UNAUTHORIZED_401) return undefined return res.json() - }).then((obj: UserRefreshToken & { code: 'invalid_grant'}) => { - if (!obj || obj.code === 'invalid_grant') { + }).then((obj: UserRefreshToken & { code?: OAuth2ErrorCode }) => { + if (!obj || obj.code === OAuth2ErrorCode.INVALID_GRANT) { Tokens.flush() this.removeTokensFromHeaders()