Files
warren/frontend/lib/api/index.ts
2025-07-17 16:36:36 +02:00

16 lines
370 B
TypeScript

export function getApiHeaders(
includeAuth: boolean = true
): Record<string, string> {
const headers: Record<string, string> = {};
if (includeAuth) {
const authSession = useAuthSession().value;
if (authSession != null) {
headers['authorization'] = `${authSession.type} ${authSession.id}`;
}
}
return headers;
}