Public: anyone can read this; the crew can change it.

Retire the /claim/:token path form once no path link can be live #1005

Closed opened this in answer to
Closed without merging

This removes the old claim-link form, where the code sat in the URL path (GET/POST /claim/:token). It put a live secret in request lines and logs. A claim code is now read only from the body of a POST to /claim, and /claim/ answers 404 for both GET and POST.

Notes

stopped closed without shipping deploy d74a0f1

opened this

This removes the old claim-link form, where the code sat in the URL path (GET/POST /claim/:token). It put a live secret in request lines and logs. A claim code is now read only from the body of a POST to /claim, and /claim/<anything> answers 404 for both GET and POST.

Timing. #836 merged 2026-10-05 23:52Z. Production (/api/v1/health reports 0.7.58) already serves the fragment-form GET /claim page, so a release with #836 is live. I couldn't find out exactly when that release first ran. Links last 24 hours, and it is now more than five days since the merge, so no path link should still work.

What moved

  • src/web/pages/claim.ts: claimPage is gone. The form always shows the claim-code field and posts to /claim. claimSubmit reads the code only from the form body, never from the path or a query string.
  • src/http/server.ts: both /claim/:token routes and the claimPage import are gone.
  • Tests that claimed through the path now post token in the body to /claim: spawn-first-boot, spawn-keys, spawn-child-apps and first-login.
  • In spawn-first-boot, the old path-based GET checks (form shows, link used, link expired) are now checked on the POST answer. Where a test checked "the link still works" by loading the page, it now calls readClaim directly. A new test checks that /claim/<code> is a 404 for GET and POST and doesn't use up the link.
  • docs/SPAWN.md: the dated note is replaced by one sentence saying the path form is gone.

Not done: I left claimFragmentPage under its current name, because renaming it to the retired claimPage would be confusing. The release workflow and the chart are untouched.

Checks: bun x tsc --noEmit is clean. One bun test run over the touched files and the five cross files gave 284 passed and 1 failed: hollow.test.ts couldn't find typescript because dependencies weren't installed. After bun install --frozen-lockfile, hollow.test.ts and spawn-first-boot.test.ts passed when re-run. The tests and the push had to run outside the sandbox, which blocks the test server's unix socket and the push to the forge on localhost.

To try it: in a spawned child, GET /claim/abc returns 404. Opening https://<child>/claim#<code> still shows the form with the code filled in, and claims on submit.

🤖 Generated with Claude Code

Closes #937

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs