mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-30 20:25:38 +00:00
qfix: provide token when fetching video meta (#7890)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
87586fb195
commit
93effa442d
@ -133,13 +133,14 @@ export async function getVideoMeta (file: string, filename?: string): Promise<Vi
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const token = getMetadata(presentation.metadata.Token) ?? ''
|
||||||
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
||||||
if (!url.includes('://')) {
|
if (!url.includes('://')) {
|
||||||
url = concatLink(frontUrl ?? '', url)
|
url = concatLink(frontUrl ?? '', url)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url)
|
const response = await fetch(url, { headers: { Authorization: `Bearer ${token}` } })
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return (await response.json()) as VideoMeta
|
return (await response.json()) as VideoMeta
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user