Update user routing, added user authorization with JWT cookie management
This commit is contained in:
parent
662b26ad47
commit
f055e77eea
7 changed files with 97 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue