add status check after refetch
All checks were successful
Deploy Amap / deploy (push) Successful in 42s

This commit is contained in:
Julien Aldon
2026-03-10 11:38:26 +01:00
parent 6a4de725b5
commit f0fd0efb7f

View File

@@ -50,6 +50,13 @@ export async function fetchWithAuth(input: RequestInfo, options?: RequestInit, r
credentials: "include",
...options,
});
if (res.status === 401) {
if (redirect)
window.location.href = `/?sessionExpired=True`;
const error = new Error("Unauthorized");
error.cause = 401
throw error;
}
return newRes;
}
if (res.status == 403) {