refacto: Replaced useless DB queries by websocket calls + patching WS auth-token leak
This commit is contained in:
@@ -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.). */
|
||||
|
||||
Reference in New Issue
Block a user