feat: Add frontend 401 unauthorized handling and update backend to async Rocket main.

This commit is contained in:
2025-12-03 12:16:49 +01:00
parent 926926f357
commit f9a4dd0851
4 changed files with 48 additions and 4 deletions
+4
View File
@@ -17,6 +17,10 @@ export const apiFetch = async (
const response = await fetch(url, config);
if (!response.ok) {
if (response.status == 401) {
localStorage.removeItem("token");
window.location.href = "/";
}
throw new Error(`Request failed with status ${response.status}`);
}