Relationships
#4913 Dashboard sign-in under a workspace segment: under a serve host the page signs in to the workspace's serve
Opened by zack · 11/19/2026
Issue 17 of the execution plan in design/surfaces/serve-workspaces.md. One PR. Depends on swamp-club#4912 (a dashboard session cookie per path).
Problem
The dashboard bundle already knows a workspace segment. A workspace's pages are /dashboard/w/<name>/… and their server calls go to /w/<name>/… (packages/dashboard/src/client/workspace_path.ts). But the page takes a workspace segment to mean the local dashboard: it asks for the local token that swamp start hands it.
Under a serve host there is no local token. The root serves the bundle, and a workspace's server calls reach that workspace's serve, which wants a dashboard session. So a hosted workspace has no dashboard.
Change
Under a host, a page with a workspace segment signs in to that workspace's serve. The design section is Dashboard.
- Telling the two apart. The page reads
/w/<name>/auth/info. The local dashboard's hub and a hosted workspace's serve answer differently, and the page follows the answer. It does not guess from the address. - Under a host. The page shows the sign-in a serve's dashboard shows today, for the workspace's own auth mode, and sends it to the workspace's serve under
/w/<name>/. The session is the workspace's, held in the cookie swamp-club#4912 scopes to that path. - Sign-out ends that workspace's session and no other.
- The root serves the pages.
/dashboard/w/<name>/…on the root answers with the bundle, and the bundle's own assets load from there. The root's own dashboard at/dashboard/is unchanged. - A workspace that is not there. The host answers 404 for an unknown workspace and 503 with a state for one that is stopped or starting. The page says which, in place of a sign-in form.
- The local dashboard is unchanged. It still uses the local token.
Decisions this issue makes
The PR states what it chose and updates the design doc.
- Whether a browser signed in to the root gets a workspace session without signing in again. The design's Sign-in section says a person signs in once, through the exchange in swamp-club#4876. The plan item says only that the page signs in to the workspace's serve. The expected answer for this PR is the direct sign-in. Using the exchange from the browser would add a dependency on swamp-club#4876 and becomes a follow-up issue if it is wanted.
- What in
/auth/infotells a host from the local dashboard. An existing field, or a new one.
Done when
- Under a host, opening
/dashboard/w/<name>/shows that workspace's sign-in, and after signing in its pages show that workspace's data. - A browser signed in to the root and to two workspaces keeps all three sessions, and signing out of one leaves the others.
- The page for a stopped workspace says it is stopped, and the page for an unknown one says it does not exist.
- The local dashboard opens a workspace with the local token as before, with no request to a serve's sign-in routes.
- A serve's own dashboard at
/dashboard/, with no workspace segment, is unchanged. - An in-process test puts the host's router in front of a root and a workspace and signs in to each through it.
- The dashboard package's tests cover both answers of
/auth/info.
Out of scope
- The switcher listing the host's workspaces. The next issue in the plan.
- A host behind a path on a reverse proxy. The bundle builds its paths from the origin.
- A host with no root. Nothing serves the bundle there.
- A workspace serving its own copy of the dashboard under
/w/<name>/dashboard/.
Open
No activity in this phase yet.
Sign in to post a ripple.