[@clerk/react v6] <SignIn> sends duplicate email_code on second-factor (MFA) step, distinct from #8463
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
事前構築済みの @clerk/react フローと、パスワード認証成功後の needs_second_factor からの遷移から始めます。prepareSecondFactor() がどこで呼び出されるかを追跡し、dashboard のイベントに表示されるバックエンドで準備された検証と比較します。password plus email_code MFA で再現し、その後、明示的な Resend の場合にのみ別のコードが送信されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Reproduction
- Instance has password as first factor,
email_codeas the (only) required second factor / MFA strategy. - Render prebuilt
<SignIn routing="path" path="/sign-in" signUpUrl="/sign-up" />(no custom flow). - Submit correct password. First factor passes cleanly (no duplicate here).
- Sign-in transitions to
needs_second_factor. Twoemail_codeverification 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/[email protected] (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
- #8463 (first-factor/remount case, closed as fixed in Core 3 — this is a different code path)
- #8684, #4324 (SignUp / prepareFirstFactor variants of the same "double prepare" pattern)
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 473
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 253
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
clerk/javascript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clerk/javascript#10033 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
clerk/javascript#10026 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
clerk/javascript#9987 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
clerk/javascript#10011 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
clerk/javascript#9984 ·
メンテナーはふだん 1 日以内に返信
clerk/javascript の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vercel/ai-elements#507 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 84/100
anaclumos/qa-interns#148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信