Updated A LOT

This commit is contained in:
2026-06-05 04:15:24 -05:00
parent 8335f1af1b
commit 4072695432
92 changed files with 16139 additions and 570 deletions

View File

@@ -9,6 +9,11 @@ export async function apiRequest(path, token, options = {}) {
});
if (!response.ok) {
const body = await response.json().catch(() => ({}));
// An invalid/expired token (401) means the session is no longer valid — signal the
// app to drop back to the login screen. (403 is a role/permission denial, not a session issue.)
if (response.status === 401) {
window.dispatchEvent(new CustomEvent('mixedassets:unauthorized'));
}
throw new Error(body.error || `Request failed: ${response.status}`);
}
return response;