1 Commits
Author SHA1 Message Date
CatoandClaude 6d47eae8a5 feat(studio): the studio site can tell who is signed in (#1672)
bitbaum.orangecat.ch is static files with no accounts of its own; a
person's account there is their Loki account. Until now its header could
not know anybody, and a builder's only way back in was a Loki page that
makes a new private link.

- GET /api/studio-session answers the studio's origin, with the reader's
  own session cookie: a name, a handle, a picture, whether they run the
  studio, and their builder applications by status. No email, no account
  or application id, no access key. Signed out is an answer (200), with
  the addresses to sign in and out at. Public on the proxy's list because
  the proxy's own 401 carries no CORS headers.
- GET /studio/return?to=/builders/ is the studio site's sign-in door:
  behind the proxy, so a signed-out visitor signs in first, then lands on
  that page of the studio site. The destination is a path on the studio's
  own origin and nothing else.
- /sign-out?then=studio ends on the studio site (/studio/left, public).
- One header shape for everything the studio site reads with a session
  (STUDIO_SESSION_HEADERS); /api/fleet/private uses it.

scripts/test/studio-session.ts pins the answer's shape, what it must
never carry, the return-path rule against open redirects, the headers,
and which of the three routes the proxy guards.

Claude-Session: https://claude.ai/code/session_019MDtmsSWTTpVpe4wh3v1sb

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 11:45:22 +01:00