fix(mfa): remove misleading Back link from post-signup MFA setup - #71
Merged
Conversation
The post-signup MFA-setup screen is shown after the account has already
been created server-side (withheld-token first-time-setup flow). Its
onBack handler only reset mfaOfferData, which toggles between the MFA
screen and the signup form. It never touched formData, so Back dropped
the user onto the signup form still pre-filled with the just-used email.
Resubmitting was guaranteed to fail with "user with given email already
exists" — Back was a dead end into a predictable duplicate-email error,
not an actual undo.
Stop passing onBack here so the {onBack && <BackLink/>} guard in
AuthorizerMFASetup hides it, leaving "Skip for now" (skipMfaSetup) as the
sole, correct way to exit. onBack usage in the login contexts
(AuthorizerBasicAuthLogin, AuthorizerPasskeyLogin, AuthorizerRoot) is
unaffected — login is idempotent with no uniqueness check.
size-limit report 📦
|
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.
Summary
onBackonly resetmfaOfferData(the screen toggle) and never touchedformData, so "Back" dropped the user onto the signup form still pre-filled with the just-used email — resubmitting was guaranteed to fail with "user with given email already exists". It was a dead end into a predictable duplicate-email error, not an undo.Changes
AuthorizerSignup.tsx: stop passingonBackto<AuthorizerMFASetup>. The existing{onBack && <BackLink/>}guard then hides the link for this screen only. "Skip for now" (skipMfaSetup) remains the correct, working exit.AuthorizerMFASetupitself.onBackin the login contexts (AuthorizerBasicAuthLogin,AuthorizerPasskeyLogin,AuthorizerRoot) is untouched — login is idempotent, no uniqueness check, so Back there is harmless and useful.Testing
npm run build(tsup) — clean.npm test(tsc --noEmit) — clean.npm run lint— fails on a pre-existing ESLint flat-config error ("root"key unsupported); reproduces identically on cleanmain, unrelated to this diff.