qfix: provide token when fetching video meta (#7890)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-02-04 06:11:06 +04:00 committed by Andrey Sobolev
parent 87586fb195
commit 93effa442d
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2

View File

@ -133,13 +133,14 @@ export async function getVideoMeta (file: string, filename?: string): Promise<Vi
return undefined
}
const token = getMetadata(presentation.metadata.Token) ?? ''
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
if (!url.includes('://')) {
url = concatLink(frontUrl ?? '', url)
}
try {
const response = await fetch(url)
const response = await fetch(url, { headers: { Authorization: `Bearer ${token}` } })
if (response.ok) {
return (await response.json()) as VideoMeta
}