Skip to content

fix(mfa): remove misleading Back link from post-signup MFA setup - #71

Merged
lakhansamani merged 1 commit into
mainfrom
fix/signup-mfa-remove-back-dead-end
Jul 28, 2026
Merged

fix(mfa): remove misleading Back link from post-signup MFA setup#71
lakhansamani merged 1 commit into
mainfrom
fix/signup-mfa-remove-back-dead-end

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Summary

  • The post-signup MFA-setup screen appears after the account is already created (withheld-token first-time-setup flow). Its onBack only reset mfaOfferData (the screen toggle) and 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". It was a dead end into a predictable duplicate-email error, not an undo.

Changes

  • AuthorizerSignup.tsx: stop passing onBack to <AuthorizerMFASetup>. The existing {onBack && <BackLink/>} guard then hides the link for this screen only. "Skip for now" (skipMfaSetup) remains the correct, working exit.
  • No change to AuthorizerMFASetup itself.
  • onBack in 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 clean main, unrelated to this diff.

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.
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.cjs 60.39 KB (+0.03% 🔺)
dist/index.mjs 60.14 KB (+0.25% 🔺)

@lakhansamani
lakhansamani merged commit 2bd3c03 into main Jul 28, 2026
5 checks passed
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.

1 participant