Skip to content

feat(cas-frontend): readable ceremony and API errors, remove tests/client (#715) - #730

Merged
Themezv merged 2 commits into
masterfrom
feat/cas-frontend-readable-errors
Sep 16, 2026
Merged

Themezv merged 2 commits into
masterfrom
feat/cas-frontend-readable-errors

Conversation

@Themezv

@Themezv Themezv commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes #715. Part of #670, last. After #729.

What

The ticket asks for one shared place; this follows the decision from #726 instead (a shared toFailure was rejected there): each screen keeps its own table of what it can say, and the checks on an error live next to the code that throws it.

  • Predicates in entities/session/ceremonies.ts, beside isCeremonyCancelled: isPasskeyAlreadyRegistered (InvalidStateError), isAuthenticatorUnsupported (NotSupportedError, ConstraintError), isWrongOrigin (SecurityError). Each sees through the WebAuthnError wrapper like the existing one.
  • Sign-in: login_not_found (a challenge the server no longer has) reads as a cancelled ceremony; SecurityError gets "Этот адрес не подходит для входа"; invalid_credential and NotAllowedError as before.
  • Create account: registration_not_found reads as cancelled; NotSupportedError, ConstraintError and the server's discoverable_credential_required get the brief's "Не получилось создать пасскей" alert; InvalidStateError and credential_already_registered get "Такой пасскей уже есть" with the link "Войти"; SecurityError the wrong-address alert; invalid_display_name under the field as before.
  • Everything else (5xx, cross_site_request, a network failure, registration_verification_failed) is the generic alert. unauthenticated is not an alert: the route loaders from feat(cas-frontend): sign-out and auth gate (#712) #727 redirect to /sign-in.
  • apps/cas/tests/client is removed: superseded by the screens, never a workspace package, nothing referenced it.
  • docs/DESIGN.md carries the new states and copy; docs/PASSKEYS.md records the hand check of the autofill offer in Safari, Chrome and Firefox.

Tests

  • ceremonies.spec.ts: the three new predicates, bare and wrapped.
  • SignInPage.spec.tsx and CreateAccountPage.spec.tsx: a case per listed code and exception name, each asserting the screen's copy and the absence of the raw message.

pnpm lint:check, pnpm fmt:check, pnpm ts-check, pnpm test:ci (62 tests) pass.

🤖 Generated with Claude Code

Themezv and others added 2 commits September 16, 2026 23:17
Every failure a ceremony can end in now has a sentence written for the
screen it lands on, and no raw message reaches the UI. The predicates
live next to the code that throws (`entities/session/ceremonies.ts`):
`isPasskeyAlreadyRegistered` (InvalidStateError), `isAuthenticatorUnsupported`
(NotSupportedError, ConstraintError), `isWrongOrigin` (SecurityError),
beside `isCeremonyCancelled`. Each screen keeps its own table, as decided
for #726: sign-in adds the wrong-address alert and reads `login_not_found`
as a cancelled ceremony; create account adds the unsupported authenticator
(also `discoverable_credential_required`), the passkey that already exists
here (also `credential_already_registered`) with the link to sign in, and
the wrong address. Outages, `cross_site_request`, network failures and a
failed server-side verification are the generic alert; `unauthenticated`
is the gate's redirect, not an alert.

The design brief carries the new copy; PASSKEYS.md records the hand check
of the autofill offer in Safari and Firefox.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The throwaway passkey client is superseded by the sign-in and create
account screens. It was never a workspace package and nothing referenced
it. PASSKEYS.md now records the hand check of the autofill offer in Chrome
as well as Safari and Firefox.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Themezv
Themezv merged commit daf3200 into master Sep 16, 2026
9 checks passed
@Themezv
Themezv deleted the feat/cas-frontend-readable-errors branch September 16, 2026 21:45
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.

cas-frontend: readable ceremony and API errors, remove tests/client

1 participant