Skip to content

[M2.2e2b] Validate account forms and clear private inputs - #66

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.2e2b-account-form-state
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.2e2b-account-form-state

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

Account forms now validate the six identity workflows before calling the generated transport. New passwords require confirmation and use the server's Unicode length policy without trimming. Login accepts either optional TOTP or recovery proof; inactive fields do not block other workflows.

Mail-request success remains non-enumerating. Codes travel only in bodies, and private fields clear on success, restart, route change and destruction. Failed uncertain requests retain their fields and retry identity. A login response cannot populate session state after its form has been abandoned.

Validation: all 26 Angular tests pass, including coverage of every account workflow, Unicode/NUL boundaries, optional MFA proof, stale responses and secret cleanup. Web lint, typecheck and production build pass. No new dependency or backend contract. Plan/spec updated. Stacked on #65; route presentation follows in M2.2e2c. No merge requested.

  • M2.2e2b criteria met
  • Validation and lifecycle regressions pass
  • Plan/spec updated
  • No URL, storage or diagnostic path for credentials

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2e2a-mutation-state branch from b95c12f to 6a67b76 Compare November 5, 2026 12:38
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.2e2a-mutation-state to main November 5, 2026 12:38
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2e2b-account-form-state branch from 8d838f1 to efe6f38 Compare November 5, 2026 12:38
@samuelmbabhazi
samuelmbabhazi merged commit 73ed40d into main Nov 5, 2026
9 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.2e2b-account-form-state branch November 5, 2026 12:39
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
Shipkeep now exposes all six account workflows through real routes and
labeled forms, replacing the starter screen. Login reaches the
session-backed account page; sign-out remains visibly unconfirmed on
failure. Existing email links reach the correct verification/reset form
without placing codes in URLs.

Shared responsive navigation, native controls, associated help/error
text, a skip link, page/result focus and a native MFA disclosure support
keyboard use. Private fields clear on departure, and an async result
cannot try to focus a destroyed page. This cohesive presentation change
exceeds the usual 500-line aim because it includes the shared CSS, six
forms and their route tests together.

Validation: all 31 Angular tests pass; web lint, typecheck and
production build pass. Route tests cover all forms, error disclosure,
login/sign-out transitions and existing mail links. Initial production
payload is 324 kB raw / 86 kB estimated transfer, below the 500 kB
warning budget. Browser/backend acceptance and the final desktop/mobile
design review remain in M2.2e4; this PR stays draft until those checks
finish.

Dependencies follow ADR 0009: Angular CDK 22.2.4,
Tailwind/@tailwindcss/postcss 4.3.3 and PostCSS 8.5.32, all MIT and
older than the seven-day release window. Existing peer warnings concern
webpack/schema-utils and openapi-typescript/TypeScript; no new Angular
peer mismatch. No new external service, secret persistence or backend
mutation. Stacked on #66; no merge requested.

- [x] Route presentation, focus and unit acceptance
- [x] Web lint/typecheck/build
- [x] Plan/spec and development-only surface brief updated
- [ ] Real-browser acceptance and final visual/accessibility review
(M2.2e4)
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
…rets on a timer (#98)

## Task

Review follow-up for #64, #66 and #68 (M2.2e1b, M2.2e2b, M2.2e3a). Refs
#21

## What changed

**Session state (`session-store.ts`)**
- Sign-out on an expired or revoked session: the server answers 401,
which now clears the local session instead of keeping "Signed in as …"
with an error that every retry repeats.
- A successful login always updates the session, even if its form was
left before the response arrived. The server has already set the session
cookie, so the UI no longer claims the user is signed out while the next
reload is authenticated. Form side effects (navigation) remain guarded
by the mutation runner.
- A login that fails while it superseded a pending session check re-runs
the check, so the account page no longer stays on "Checking your
session…" until reload.

**One-time secrets (`mfa-form-store.ts`, `token-form-store.ts`)**
- Recovery codes and newly created API tokens are no longer hidden by a
fixed 10-minute timer. They stay until the user acknowledges them,
leaves the page or rotates the session.
- The provisioning seed keeps its timer, which follows the real server
expiry.
- Panel texts and SPEC updated.

## Why

- The 401 sign-out trapped users in a signed-in UI until a full reload
(#64).
- The ignored login left a live server session invisible to the user
(#66).
- The server shows recovery codes and API tokens exactly once. Hiding
them after 10 minutes, with no warning or extension, fails WCAG 2.2.1
(Timing Adjustable, level A) on a core flow. A slow or screen-reader
user copying ten 32-character codes could lose them and then need a TOTP
code to regenerate them (#68).

## How it was tested

- New and updated unit tests: 401 sign-out clears the session; a failed
login that superseded a pending check settles the state; recovery codes
and API tokens are still displayed after an hour without
acknowledgement.
- `nx run-many -t lint typecheck test build -p web` in a clean worktree:
11 files, 52 tests pass; production build passes.
- Browser acceptance could not run: GitHub Actions is blocked by the
account spending limit. CI must pass before merge.

## Security considerations

- Secrets stay in memory longer only while the account page is open and
only until acknowledgement. Departure, session rotation and
acknowledgement still clear them, and they still never serialize out of
the stores.
- The signed-out state after a 401 matches the server state.

## Checklist

- [x] Lint, typecheck, tests and build pass locally
- [x] Tests added and updated
- [x] No new shell invocation and no new secret exposure path
- [x] Audit events: not applicable (client only)
- [x] SPEC updated
- [ ] CI green (blocked by billing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant