AZ-010 — Password recovery

Status

In progress

Context

Read README. Login/session/password policy and password change exist. Resend adapter and local Mocking Bird synthetic mail previews exist. There is no self-registration or email change flow; provisioned user's normalized email is the recovery address. Use OWASP recovery guidance and maintained crypto/password libraries rather than inventing a token protocol.

Goal

Deliver mobile forgot/reset-password with non-enumerating requests, short-lived single-use credentials, revocation and real browser/database tests using mocked external email.

Requirements

Non-goals

No email address change/verification, self-registration, invitations/MFA, token export, production mail preview, queue workers, bulk notifications, or live provider deployment/signup.

Implementation guidance

Keep token/password use cases independent of Fastify; repositories own concrete transactional queries, schema/migrations remain in packages/db. Use the current policy/hasher, CSRF boundary, query/cache clearing and email adapter, not parallel implementations. Frontend wrappers own body and response parsing. Server no-store/referrer and frontend fragment removal have separate tests. Mutation/schema logging must not print token request bodies; test sensitive sentinel absence.

Acceptance criteria

Verification

pnpm db:generate
pnpm quality
pnpm test
pnpm build
pnpm test:coverage
pnpm validate:docker

Review generated SQL/journal; migrations need fresh/message-schema-upgrade/rerun proof. Add token policy/cleanup/template unit, injection/error/redaction, real transaction/concurrency, RTL form, and mobile/desktop Playwright recovery cases. Manual phone check: email link opening, fragment removal, keyboard/autofill, refresh/reopen-link guidance, 320px/200% zoom, expired-link recovery. Do not send real mail or reset hosted credentials for local acceptance. Actual configured sender and delivery/TLS/origin are release prerequisites to verify when that work is authorized.

Documentation

Update OpenAPI, auth ADR/architecture (credential lifecycle/transaction/non-enumeration limitations), development (APP_PUBLIC_URL/provider configuration and local recovery), testing (real DB/mock email), Docker/CI fixtures/redaction, current-state/handover. State that provider acceptance is not inbox delivery and that local success supplies no hosted release evidence.

Dependencies

AZ-007 and AZ-009; both include earlier auth, shell, errors/logging and mail capture.