Update user routing, added user authorization with JWT cookie management

This commit is contained in:
Hannah dagemark 2026-09-14 23:09:11 +02:00
commit f055e77eea
7 changed files with 97 additions and 10 deletions

View file

@ -14,3 +14,18 @@ export async function cmFetch<T>(
return response.json();
}
export async function cmFetchRaw(
bffUrl: string | URL,
options?: RequestInit,
ignoreStatuses?: number[],
): Promise<Response> {
const response = await fetch(`${FRONTEND_URL}/${bffUrl}`, options);
if (!response.ok && !ignoreStatuses?.includes(response.status)) {
throw new Error("Request failed");
}
console.log(response);
return response;
}