Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The identity line on /story and /admin/data #594
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
`/story` and `/admin/data` now show who you are, with Sign out, the same way the arm's page and `/admin` do. The five suites that cover this pass, including the new tests. I didn't get a type check, because `tsc` couldn't find the Bun type definitions here.
shipped merged
/story and /admin/data now show who you are, with Sign out, the same way the arm's page and /admin do. The five suites that cover this pass, including the new tests. I didn't get a type check, because tsc couldn't find the Bun type definitions here.
- Both pages: each renders
renderSignedIn()withSIGNED_IN_STYLEin its pinned style, and its CSP now saysform-action 'self'. /story: the line sits under the nav. A guest sees "Watching as a guest · Sign in", which returns to/story.serveStorytakes an optionalsignedIn(req)thatsrc/relay.tssupplies. Without it, as with no lobby or on a local run, the page has no line./storycaching: a page with a name on it waspublic, max-age=60. It is nowprivate, max-age=60, and the line-free page keepspublic./admin/data:renderDataPage(who)puts the line in the header, and the page passeslobby.signedIn(req). Only the owner and moderators get this page, so a guest sees a 404 and never reaches the line. I checked the guest version by renderingrenderDataPage(null)directly.- Tests: two new ones in
src/signout.test.tscheck the line, the Sign out form, the CSP and the cache header on each page. For/storythey cover a guest, a forge identity and a name made here. For/admin/datathey cover the owner and the rendered guest line. - Design lint: I couldn't run it, because
scripts/design-lint.tsisn't in this clone.
Works in the preview: /story answers 200 with the guest line and Sign in returning to /story, form-action is 'self' in the CSP, and the cache header is private. The style variables the line uses exist on the story page, and the Sign out button keeps its 44px target. The name is escaped by renderSignedIn, and identity comes from lobby.signedIn, so nothing is read from a cookie or query that the lobby does not verify. Next, in order: (1) give the new tests an honest title (they say #593 and this is #594) and merge the two imports from signed-in.ts; (2) put SIGNED_IN_STYLE on its own line in STORY_STYLE instead of glued to the a rule. I could not look at the screenshots: the sandbox denies reading /data/looks.
/storyand/admin/datanow show who you are, with Sign out, the same way the arm's page and/admindo. The five suites that cover this pass, including the new tests. I didn't get a type check, becausetsccouldn't find the Bun type definitions here.renderSignedIn()withSIGNED_IN_STYLEin its pinned style, and its CSP now saysform-action 'self'./story: the line sits under the nav. A guest sees "Watching as a guest · Sign in", which returns to/story.serveStorytakes an optionalsignedIn(req)thatsrc/relay.tssupplies. Without it, as with no lobby or on a local run, the page has no line./storycaching: a page with a name on it waspublic, max-age=60. It is nowprivate, max-age=60, and the line-free page keepspublic./admin/data:renderDataPage(who)puts the line in the header, and the page passeslobby.signedIn(req). Only the owner and moderators get this page, so a guest sees a 404 and never reaches the line. I checked the guest version by renderingrenderDataPage(null)directly.src/signout.test.tscheck the line, the Sign out form, the CSP and the cache header on each page. For/storythey cover a guest, a forge identity and a name made here. For/admin/datathey cover the owner and the rendered guest line.scripts/design-lint.tsisn't in this clone.Closes #593