Skip to content

fix(auth): harden one-time link recovery - #73

Merged
StringKe merged 2 commits into
mainfrom
codex/one-time-link-recovery
Aug 14, 2026
Merged

fix(auth): harden one-time link recovery#73
StringKe merged 2 commits into
mainfrom
codex/one-time-link-recovery

Conversation

@StringKe

Copy link
Copy Markdown
Owner

Summary

  • bind one-time-link recovery to the originating browser History entry so stale sessionStorage credentials are never reused on unrelated navigation
  • clear terminally rejected credentials while retaining retryable failures, and render branded localized recovery UI instead of raw API JSON
  • add low-cardinality server-side rejection reasons for Magic Link verification without logging credentials, URLs, user identifiers, or provider payloads
  • align authentication and operations design docs plus Lingui catalogs

Root cause

The scrubbed credential was retained under a route-wide sessionStorage key without proving that the current History entry originated from that link. A later visit could therefore recover a stale one-time credential. Terminal errors also shared UI behavior with transient failures, which either left stale state behind or prevented a safe retry. Existing structured logs identified only the public error code, not the failed verification stage.

User impact

Magic Link, email verification, and password reset pages now keep credentials only for same-entry reload recovery. Expired or invalid credentials transition to localized recovery states, transient failures expose a retry action, and users never see raw JSON from these Hosted UI flows.

Validation

  • pnpm check

  • pnpm test

  • focused Core regression suite: 40 tests

  • pnpm --filter @xid-kit/server typecheck

  • pnpm run security:secret-scan

  • git diff --check

  • No secrets, .env files, real tokens, private keys, or real tenant data in the diff

  • Commit includes DCO sign-off

Signed-off-by: StringKE <stringke.me@gmail.com>
Signed-off-by: StringKE <stringke.me@gmail.com>
@StringKe
StringKe merged commit b1c15ac into main Aug 14, 2026
11 checks passed
@StringKe
StringKe deleted the codex/one-time-link-recovery branch August 14, 2026 08:48
@StringKe StringKe mentioned this pull request Aug 14, 2026
2 tasks
StringKe added a commit that referenced this pull request Aug 14, 2026
Bump the repository release version to 0.0.5 and generate release notes for the one-time-link recovery fix merged in PR #73.

Signed-off-by: StringKE <stringke.me@gmail.com>
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.

1 participant