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

A forge sent in a link shows its recipient the date the link stops working, and a link past it says so plainly #14629

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A live access link now says when it stops working, and a link past its hour answers a plain 410 page. I ran the access-link tests, tsc, gate.ts and design-lint, and all pass. I did not run the full suite; the forge runs it on the push.

Notes

shipped production is serving it deploy 4ec2c16

opened this

A live access link now says when it stops working, and a link past its hour answers a plain 410 page. I ran the access-link tests, tsc, gate.ts and design-lint, and all pass. I did not run the full suite; the forge runs it on the push.

  • Live link: /signin/access/<secret> shows "This link works until <date> UTC" above the password form.
  • Expired link: the page and a password submit on a lapsed link answer 410 titled "This link has expired". Its one next step is "Ask the person who sent it to send you a new one." It shows no username, id or secret in the page body.
  • Spent, withdrawn or unknown links: these still answer the existing 404 "Link not valid", so an outsider cannot tell them apart.
  • Code: the new check is accessLinkStanding in src/core/access_link.ts, with the page logic in src/web/pages/passkeys.ts.
  • Tests: test/access-link-expiry.test.ts covers a live link, one a minute from its end, an expired link, and an unknown link. I changed the existing "a link fails after an hour" test in test/account-access.test.ts from 404 to 410, because the old status was the behaviour this issue replaces.
  • Side effects: I switched the page heads in src/web/pages/passkeys.ts to pageHead because the design lint flagged them, and lowered the debt count in docs/design/quiet-debt.json. I added one line about the date and the 410 to docs/features/account-access.md.

I left out revoke and re-issue (#14518). A link withdrawn by a new one still reads as "not valid", not "expired". I also made no changes to the terminal or the API, since they only make and show the link. The commit says No look and No door, because the page sits behind a one-use secret and the terminal is unchanged.

To try it: as an admin, open Manage account → Reset access, then open the link to see the date. After an hour (or with a link made 2 hours back in a test) it answers 410.

🤖 Generated with Claude Code

Closes #14591

commented

A live access link now says when it stops working, and a link past its hour answers a plain 410 page. I ran the access-link tests, tsc, gate.ts and design-lint, and all pass. I did not run the full suite; the forge runs it on the push.

  • Live link: /signin/access/<secret> shows "This link works until <date> UTC" above the password form.
  • Expired link: the page and a password submit on a lapsed link answer 410 titled "This link has expired". Its one next step is "Ask the person who sent it to send you a new one." It shows no username, id or secret in the page body.
  • Spent, withdrawn or unknown links: these still answer the existing 404 "Link not valid", so an outsider cannot tell them apart.
  • Code: the new check is accessLinkStanding in src/core/access_link.ts, with the page logic in src/web/pages/passkeys.ts.
  • Tests: test/access-link-expiry.test.ts covers a live link, one a minute from its end, an expired link, and an unknown link. I changed the existing "a link fails after an hour" test in test/account-access.test.ts from 404 to 410, because the old status was the behaviour this issue replaces.
  • Side effects: I switched the page heads in src/web/pages/passkeys.ts to pageHead because the design lint flagged them, and lowered the debt count in docs/design/quiet-debt.json. I added one line about the date and the 410 to docs/features/account-access.md.

I left out revoke and re-issue (#14518). A link withdrawn by a new one still reads as "not valid", not "expired". I also made no changes to the terminal or the API, since they only make and show the link. The commit says No look and No door, because the page sits behind a one-use secret and the terminal is unchanged.

To try it: as an admin, open Manage account → Reset access, then open the link to see the date. After an hour (or with a link made 2 hours back in a test) it answers 410.

🤖 Generated with Claude Code

Approved

Does what the issue asks, small and in the existing shape. Live link shows the date in a time element, an expired link answers 410 with one next step and no ids, and unknown or spent links stay an indistinguishable 404. Page heads moved to pageHead and the debt entry dropped. Docs went in docs/features, not the README. Works without JavaScript. Two things I would do next: (1) accessPage and accessSubmit now query the link twice (accessLinkPerson then accessLinkState); fold them into one lookup. (2) Show the expiry in the reader's local time via the time element, or add a relative form, since a bare UTC stamp is hard to read on a phone. Note: this is a feature while the direction says pipeline first; it is small and green so I do not hold it for that.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs