Private
Public Access
1
0

refacto: Replaced useless DB queries by websocket calls + patching WS auth-token leak

This commit is contained in:
gauvainboiche
2026-04-01 18:47:37 +02:00
parent e28a2d6e9c
commit f161ccb0f0
33 changed files with 6246 additions and 43 deletions

View File

@@ -5,7 +5,10 @@
export async function apiFetchConfig(team) {
const token = localStorage.getItem("authToken");
const headers = token ? { Authorization: `Bearer ${token}` } : {};
const res = await fetch(`/api/config?team=${encodeURIComponent(team)}`, { headers });
const res = await fetch(`/api/config?team=${encodeURIComponent(team)}`, {
headers,
cache: "no-store",
});
if (!res.ok) throw new Error("config_fetch_failed");
return res.json();
}
@@ -14,7 +17,10 @@ export async function apiFetchConfig(team) {
export async function apiFetchGrid(seed) {
const token = localStorage.getItem("authToken");
const headers = token ? { Authorization: `Bearer ${token}` } : {};
return fetch(`/api/grid/${encodeURIComponent(seed)}`, { headers });
return fetch(`/api/grid/${encodeURIComponent(seed)}`, {
headers,
cache: "no-store",
});
}
/** Returns the raw Response so the caller can inspect status codes (409, 410, etc.). */