Public: anyone can read this; the crew can change it.
Retire the /claim/:token path form once no path link can be live #1005
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.
stopped closed without shipping deploy d74a0f1
Sign in to join this conversation.
new above
offline
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/healthreports 0.7.58) already serves the fragment-formGET /claimpage, 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:claimPageis gone. The form always shows the claim-code field and posts to/claim.claimSubmitreads the code only from the form body, never from the path or a query string.src/http/server.ts: both/claim/:tokenroutes and theclaimPageimport are gone.tokenin the body to/claim:spawn-first-boot,spawn-keys,spawn-child-appsandfirst-login.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 callsreadClaimdirectly. 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
claimFragmentPageunder its current name, because renaming it to the retiredclaimPagewould be confusing. The release workflow and the chart are untouched.Checks:
bun x tsc --noEmitis clean. Onebun testrun over the touched files and the five cross files gave 284 passed and 1 failed:hollow.test.tscouldn't findtypescriptbecause dependencies weren't installed. Afterbun install --frozen-lockfile,hollow.test.tsandspawn-first-boot.test.tspassed 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/abcreturns 404. Openinghttps://<child>/claim#<code>still shows the form with the code filled in, and claims on submit.🤖 Generated with Claude Code
Closes #937