diff --git a/dashboard/dist/index.js b/dashboard/dist/index.js index 52eac3d..4f1ca9c 100644 --- a/dashboard/dist/index.js +++ b/dashboard/dist/index.js @@ -6,9 +6,16 @@ const { useState, useEffect, useCallback } = SDK.hooks; const { Card, CardHeader, CardTitle, CardContent, Button } = SDK.components; - // Use native fetch with credentials for remote dashboard + // Use native fetch with session token header for remote dashboard + function getSessionToken() { + return window.__HERMES_SESSION_TOKEN__ || ""; + } + async function apiFetch(path) { - const res = await fetch(path, { credentials: "include" }); + const res = await fetch(path, { + credentials: "include", + headers: { "x-hermes-session-token": getSessionToken() } + }); if (!res.ok) { const text = await res.text(); throw new Error("API error " + res.status + ": " + text.slice(0, 100)); @@ -19,7 +26,8 @@ async function apiPost(path) { const res = await fetch(path, { method: "POST", - credentials: "include" + credentials: "include", + headers: { "x-hermes-session-token": getSessionToken() } }); if (!res.ok) { const text = await res.text();