[@clerk/react v6] <SignIn> sends duplicate email_code on second-factor (MFA) step, distinct from #8463 · Issue #9287 · clerk/javascript · GitHub
Skip to content

[@clerk/react v6] <SignIn> sends duplicate email_code on second-factor (MFA) step, distinct from #8463 #9287

Open

Description

@sdmgill

Reproduction

  1. Instance has password as first factor, email_code as the (only) required second factor / MFA strategy.
  2. Render prebuilt <SignIn routing="path" path="/sign-in" signUpUrl="/sign-up" /> (no custom flow).
  3. Submit correct password. First factor passes cleanly (no duplicate here).
  4. Sign-in transitions to needs_second_factor. Two email_code verification emails arrive ~1 second apart; the first code is invalidated by the second.

Dashboard log evidence (single sign_in_id, single client)

sign_in.attempt_first_factor.passed       strategy=password         (T+0.0s)
sign_in.email_address.verification_code_sent                        (T+0.0s)  <- code #1
sign_in.prepare_second_factor.passed      strategy=email_code, new verification_id (T+0.0s)
sign_in.email_address.verification_code_sent                        (T+1.0s)  <- code #2, invalidates #1

Same sign_in_id, same client_id, same IP across all four events — this is one browser tab, one attempt, not a remount/refresh or a second tab.

Why this looks like a sibling of #8463, not a duplicate report

#8463 (closed, "fixed in Core 3") and #8684/#4324 are about prepareFirstFactor / SignUp.create() re-sending a code on remount or because create() already prepares under the hood before an explicit prepare call fires again.

This reproduces on @clerk/react@6.12.9 (Core 3, current latest), with no remount involved — it's the transition from first-factor success straight into the second-factor (MFA) step, in a single mount. It looks like the same class of bug (backend/widget both send a code for the same verification step) but on the prepareSecondFactor code path specifically, which doesn't appear to have been covered by the Core 3 fix for the first-factor case.

Expected behavior

When a sign-in transitions to needs_second_factor and email_code is the strategy, <SignIn> should resume on whatever verification the backend already prepared for that transition (if any) rather than unconditionally calling prepareSecondFactor() again. A second code should only be sent when the user explicitly clicks "Resend."

Environment

  • @clerk/react: 6.12.9
  • React: 19, Vite 6
  • pk_test_* instance, password + email_code (as second factor/MFA) enabled
  • Reproduces in Chrome (desktop), consistently, every sign-in attempt requiring the second factor

Related

Activity

  1. Angel-SunSur commented on Aug 26, 2026

    @Angel-SunSur

    Experiencing the same issue

  2. Ethan-Robbins-Developer commented on Aug 27, 2026

    @Ethan-Robbins-Developer

    Experiencing the same issue are there any plans to fix this?

  3. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Hello 👋

    We currently close issues after 40 days of inactivity. It's been 30 days since the last update here. If we missed this issue, please reply here. Otherwise, we'll close this issue in 10 days.

    As a friendly reminder: The best way to see an issue fixed is to open a pull request. If you're not sure how to do that, please check out our contributing guide.

    Thanks for being a part of the Clerk community! 🙏

  4. sdmgill commented on Sep 28, 2026

    @sdmgill
    Author

    Have you made any steps to correct the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions