Skip to content

feat(accounts): check the password-reset link before the new password is typed - #19

Merged
Wjouter merged 3 commits into
mainfrom
009-reset-link-precheck
Oct 21, 2026
Merged

Wjouter merged 3 commits into
mainfrom
009-reset-link-precheck

Conversation

@Wjouter

@Wjouter Wjouter commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • The reset page now asks a new side-effect-free POST /api/auth/password-reset/check { token } when it opens, and shows the existing "link no longer works" panel instead of the form when the link is used, expired, replaced, unknown, missing, or the account is disabled.
  • The "still usable" lookup moved into one helper (FindResetAsync) shared by the check and the submit, so both apply the same rules; submitting still checks again.
  • After a submit the page load skips the check, so the action's result (done / token_invalid / password error) decides the page.
  • No schema, text or dependency changes. Spec: specs/009-reset-link-precheck/.

Test plan

  • dotnet test filtered to SignInTests|ApiTests|LogHygieneTests: 37 passed (new: ResetCheckRefusesDeadLinks, ResetCheckChangesNothing)
  • npm test (143 passed, incl. new reset.test.ts) and npm run check
  • Quickstart manual steps 1–5 on the dev stack with Mailpit: form shows and survives reloads, new password works, reused link and no/nonsense token show the panel, backend down shows the 503 error page

🤖 Generated with Claude Code

Wjouter and others added 3 commits October 21, 2026 14:53
…typed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is typed

The reset page asks a new side-effect-free POST /api/auth/password-reset/check
whether the link is still usable and shows the "link no longer works" panel
instead of the form when it is not. The lookup is shared with the submit, so
both apply the same rules; submitting still checks again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Wjouter
Wjouter merged commit 9653c3c into main Oct 21, 2026
6 checks passed
@Wjouter
Wjouter deleted the 009-reset-link-precheck branch October 21, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Email: check password-reset link validity before the user types a new password

1 participant