From 06d57a61f8165ba9ab341bbfe05039bb2d12298c Mon Sep 17 00:00:00 2001 From: iris Date: Tue, 16 Jun 2026 09:53:18 +0200 Subject: [PATCH] dashboard: fix matrix-accounts GET path to /api/matrix-accounts BE-1 (the list endpoint) lives at GET /api/matrix-accounts (reads go under /api/, matching /api/state and /api/operator-inbox); the page was calling the un-prefixed /matrix-accounts. Correct the fetch + the contract comment + the docs reference. POST /matrix-account-login (mutation, root path like /approve) is unchanged. --- docs/web-ui/dashboard.md | 2 +- frontend/packages/dashboard/src/matrix-accounts.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index 06006d81..f44c7bad 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -212,7 +212,7 @@ purpose-built endpoints. An agent picker (populated from `state.agents`) drives a list of that agent's configured accounts — name, homeserver, and a token-status dot — -read from `GET /matrix-accounts?agent=` → +read from `GET /api/matrix-accounts?agent=` → `{ accounts: [ { name, homeserver, token_present } ] }`. The status reflects only whether a token is **stored** (labelled "token stored", not "online"); a true live up/down indicator needs the matrix daemon's diff --git a/frontend/packages/dashboard/src/matrix-accounts.js b/frontend/packages/dashboard/src/matrix-accounts.js index 9fa354be..a71a2dd9 100644 --- a/frontend/packages/dashboard/src/matrix-accounts.js +++ b/frontend/packages/dashboard/src/matrix-accounts.js @@ -5,7 +5,7 @@ // repo. Companion to the multi-account harness support. // // Backend contract (v1): -// GET /matrix-accounts?agent= +// GET /api/matrix-accounts?agent= // -> { accounts: [ { name, homeserver, token_present: bool } ] } // POST /matrix-account-login (x-www-form-urlencoded, operator-auth) // fields: agent, account, homeserver, mode=password|token, @@ -62,7 +62,7 @@ async function loadAccounts(agent) { list.replaceChildren(el('p', { class: 'meta' }, 'loading…')); let data; try { - const resp = await fetch('/matrix-accounts?agent=' + encodeURIComponent(agent)); + const resp = await fetch('/api/matrix-accounts?agent=' + encodeURIComponent(agent)); if (!resp.ok) throw new Error('HTTP ' + resp.status); data = await resp.json(); } catch (err) {