feat(cas-frontend): readable ceremony and API errors, remove tests/client (#715) - #730
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
toFailurewas 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.entities/session/ceremonies.ts, besideisCeremonyCancelled:isPasskeyAlreadyRegistered(InvalidStateError),isAuthenticatorUnsupported(NotSupportedError,ConstraintError),isWrongOrigin(SecurityError). Each sees through theWebAuthnErrorwrapper like the existing one.login_not_found(a challenge the server no longer has) reads as a cancelled ceremony;SecurityErrorgets "Этот адрес не подходит для входа";invalid_credentialandNotAllowedErroras before.registration_not_foundreads as cancelled;NotSupportedError,ConstraintErrorand the server'sdiscoverable_credential_requiredget the brief's "Не получилось создать пасскей" alert;InvalidStateErrorandcredential_already_registeredget "Такой пасскей уже есть" with the link "Войти";SecurityErrorthe wrong-address alert;invalid_display_nameunder the field as before.cross_site_request, a network failure,registration_verification_failed) is the generic alert.unauthenticatedis not an alert: the route loaders from feat(cas-frontend): sign-out and auth gate (#712) #727 redirect to/sign-in.apps/cas/tests/clientis removed: superseded by the screens, never a workspace package, nothing referenced it.docs/DESIGN.mdcarries the new states and copy;docs/PASSKEYS.mdrecords 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.tsxandCreateAccountPage.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