diff --git a/plugins/hermes-achievements/dashboard/dist/index.js b/plugins/hermes-achievements/dashboard/dist/index.js index e51227991d9..4fa9bd08065 100644 --- a/plugins/hermes-achievements/dashboard/dist/index.js +++ b/plugins/hermes-achievements/dashboard/dist/index.js @@ -50,7 +50,9 @@ async function api(path, options) { const url = "/api/plugins/hermes-achievements" + path; - const res = await fetch(url, options || {}); + const token = window.__HERMES_SESSION_TOKEN__ || ""; + const headers = { ...(options?.headers || {}), Authorization: `Bearer ${token}` }; + const res = await fetch(url, { ...options, headers }); if (!res.ok) { const text = await res.text().catch(function () { return res.statusText; }); throw new Error(res.status + ": " + text);