export function getAuthHeader(): ['authorization', string] | null { const authSession = useAuthSession().value; if (authSession == null) { return null; } return ['authorization', `${authSession.type} ${authSession.id}`]; } export function getApiHeaders( includeAuth: boolean = true ): Record { const headers: Record = { cookie: document.cookie, }; if (includeAuth) { const header = getAuthHeader(); if (header != null) { headers[header[0]] = header[1]; } } headers['content-type'] = 'application/json'; return headers; }