fix: support authenticated video citation playback
This commit is contained in:
@@ -38,6 +38,13 @@ const normalizeUrl = (url: string) => `${currentApiBase()}${url.startsWith('/')
|
||||
|
||||
export const apiUrl = normalizeUrl;
|
||||
|
||||
export const apiMediaUrl = (url: string) => {
|
||||
const normalized = normalizeUrl(url);
|
||||
if (/^https?:\/\//i.test(normalized) || typeof window === 'undefined') return normalized;
|
||||
const origin = window.location?.origin;
|
||||
return /^https?:\/\//i.test(origin || '') ? new URL(normalized, `${origin}/`).toString() : normalized;
|
||||
};
|
||||
|
||||
export const authHeaders = (json = true, includeAuth = true) => {
|
||||
const auth = getAuth();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user