Title:
Open Graph Title:
X Title:
Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk support via email or Discord This issue ...
Open Graph Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ...
X Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ...
Opengraph URL: https://github.com/clerk/javascript/issues/9984
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\u003cUserProfile />: SMS \"Set as default\" shows the raw reverification error instead of launching reverification, and has no effect while an authenticator app is enrolled","articleBody":"### Preliminary Checks\n\n- [x] I have reviewed the documentation: https://clerk.com/docs\n- [x] I have searched for existing issues: https://github.com/clerk/javascript/issues\n- [x] I have not already reached out to Clerk support via email or Discord\n- [x] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk.\n\n### Reproduction\n\nNo hosted reproduction. The behaviour is in the prebuilt `\u003cUserProfile />` and `\u003cSignIn />` components themselves, and needs no custom code. Every source line is linked below. You can reproduce it in any app that renders `\u003cUserProfile />` on an instance with **Authenticator application** and **SMS verification code** MFA enabled; the steps are at the end.\n\n### Publishable key\n\nNot provided. The problem isn't specific to our instance, and it shows up on any instance with the MFA settings above.\n\n### Description\n\nIn the MFA section of the prebuilt `\u003cUserProfile />`, the **\"Set as default\"** action on an SMS second factor behaves inconsistently. Below, we separate what **we observed at runtime** from what we **confirmed only by reading Clerk's source**. We did not create a test instance or test user to execute the source-confirmed parts.\n\n#### 1. Runtime-confirmed: \"Set as default\" doesn't launch reverification, and shows the raw error instead\n\n**Observed:** a signed-in user opens `\u003cUserProfile />` → Security and chooses **⋯ → Set as default** on an SMS MFA phone number. The card shows the raw error:\n\n> You need to provide additional verification to perform this operation.\n\nNo reverification modal opens, the action isn't retried, and the user is stuck. We saw this in production with clerk-js 5.127.2 and an unmodified `\u003cUserProfile />` (only two appearance classes passed; no custom pages or localization).\n\n**Cause (source-confirmed):** the action calls `makeDefaultSecondFactor()` directly, without `useReverification`:\n\n- [`MfaSection.tsx:175` @ clerk-js 5.127.2](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx#L175): `onClick: () => phone.makeDefaultSecondFactor().catch(err => handleError(err, [], card.setError))`\n- The same line is on `main`: [`packages/ui/.../MfaSection.tsx:175`](https://github.com/clerk/javascript/blob/e34a5cc2622e05eea9a683651e0784ad23705bb2/packages/ui/src/components/UserProfile/MfaSection.tsx#L175)\n\nAs far as we can tell, the other sensitive mutations in `UserProfile/` are wrapped in `useReverification`: creating phone, email, TOTP, backup codes and passkeys; changing the primary email/phone; changing the password; revoking a session; deleting the user; and the removals via `RemoveResourceForm`. So this looks like an omission.\n\n#### 2. Source-confirmed: with an authenticator app enrolled, the authenticator is always \"Default\", yet SMS rows keep offering \"Set as default\"\n\n- [`:35`](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx#L35): `showTOTP = secondFactors.includes('totp') && user.totpEnabled`\n- [`:72`](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx#L72): the authenticator-app row always renders the `badge__default` (\"Default\") badge.\n- [`:88`](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx#L88): `const isDefault = !showTOTP && phone.defaultSecondFactor;`. While TOTP is enrolled, no SMS row can show \"Default\", whatever its `defaultSecondFactor` value.\n- [`:172–175`](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx#L172-L175): \"Set as default\" is offered whenever `!isDefault`. So every SMS row keeps offering it, including after the action has succeeded.\n\n#### 3. Source-confirmed: prebuilt sign-in always starts on TOTP before phone code, so `defaultSecondFactor` doesn't make SMS the first second-factor screen\n\n- [`SignIn/utils.ts:99–115` @ 5.127.2](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/SignIn/utils.ts#L99-L115) (`main`: [`packages/ui/.../SignIn/utils.ts:100`](https://github.com/clerk/javascript/blob/e34a5cc2622e05eea9a683651e0784ad23705bb2/packages/ui/src/components/SignIn/utils.ts#L100)): `determineStartingSignInSecondFactor` returns the `totp` factor whenever one exists, and only then falls back to `phone_code`. It doesn't consult `defaultSecondFactor`.\n- The reverification modal uses the same function ([`UserVerificationFactorTwo.tsx:49`](https://github.com/clerk/javascript/blob/a5d08e04a73d80357497600517fb66819299be06/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwo.tsx#L49)).\n\nSo for a user with an authenticator app and a verified SMS factor, from the source: even when \"Set as default\" succeeds (`default_second_factor: true`), the badge stays on the authenticator app and sign-in still opens on the authenticator-code step. As we read it, `defaultSecondFactor` only orders phone numbers against each other, and nothing in the UI says so. The `PhoneNumber` reference describes `makeDefaultSecondFactor()` as marking the number as *the* default second factor for MFA, which suggests a stronger effect.\n\n#### 4. Questions and requests\n\n**Is this intentional?**\n\n- **If yes:** please don't show \"Set as default\" on SMS rows as if it changes the user's preferred MFA method. For example, hide it while an authenticator app is enrolled, or explain what it does.\n- **If not:**\n 1. wrap `makeDefaultSecondFactor()` in `useReverification`, so the user gets the reverification flow and the action retries;\n 2. make the displayed \"Default\" state consistent with the user's actual default second factor;\n 3. have the prebuilt `\u003cSignIn />` (and the reverification modal) honour the user's preferred/default second factor, **or** provide a supported configuration for SMS-vs-TOTP priority.\n\n#### Steps to reproduce (development instance, test user)\n\n1. Enable MFA with **Authenticator application** and **SMS verification code**; keep the default reverification window.\n2. Sign up a test user, enrol an authenticator app, then add and verify an SMS second factor.\n3. Open `\u003cUserProfile />` → Security. The authenticator app shows **Default**, and the SMS row's ⋯ menu shows **Set as default**.\n4. **Item 1:** once the session is outside the reverification window, choose ⋯ → **Set as default** on the SMS row.\n - Expected: the reverification modal opens, and the action retries.\n - Actual (as observed by us): the raw error above.\n5. **Items 2–3:** right after a fresh sign-in, choose ⋯ → **Set as default** on the SMS row, then sign out and back in.\n - Expected: SMS shows **Default**, and sign-in starts with SMS; or the action isn't offered.\n - Expected per the source (not executed by us): the request succeeds, but the badge stays on the authenticator app, the action is still offered, and sign-in starts on the authenticator-code step.\n\n### Environment\n\n```\n@clerk/clerk-js (loaded in the browser): 5.127.2 (the same code is on v5 latest and on main e34a5cc262 / packages/ui)\n@clerk/nextjs: 6.39.4\n@clerk/clerk-react: 5.61.7\n@clerk/shared: 3.47.6\nComponents: prebuilt \u003cUserProfile /> and \u003cSignIn />, no customisation beyond appearance classes\n```\n","author":{"url":"https://github.com/VIICEAI","@type":"Person","name":"VIICEAI"},"datePublished":"2026-09-29T19:22:17Z","url":"https://github.com/clerk/javascript/issues/9984"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9e97068f-9741-b217-c441-bb074db83cd1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAF0:9D91A:756078:A61F4C:6AFB6B94 |
| html-safe-nonce | 853f9033994fb86a36b30e4a231e7422cdc17c74496c673969fccff05adf6cb2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUYwOjlEOTFBOjc1NjA3ODpBNjFGNEM6NkFGQjZCOTQiLCJ2aXNpdG9yX2lkIjoiMTM4NzExMjExMDExMzkwOTY1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dde052d949d3e990c00bf40048ffa3ea9ed64e1ea9c4c5d07b0bb197bc18f4c0 |
| hovercard-subject-tag | issue:5635796123 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clerk/javascript/9984/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc1ca3f91b6847ed4dfcf8fd72383863fb33d5812aa688f6d56f0f1ae6b2daec/clerk/javascript/issues/9984 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc1ca3f91b6847ed4dfcf8fd72383863fb33d5812aa688f6d56f0f1ae6b2daec/clerk/javascript/issues/9984 |
| og:image:alt | Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | VIICEAI |
| hostname | github.com |
| expected-hostname | github.com |
| None | cca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700 |
| turbo-cache-control | no-preview |
| go-import | github.com/clerk/javascript git https://github.com/clerk/javascript.git |
| octolytics-dimension-user_id | 49538330 |
| octolytics-dimension-user_login | clerk |
| octolytics-dimension-repository_id | 438331492 |
| octolytics-dimension-repository_nwo | clerk/javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 438331492 |
| octolytics-dimension-repository_network_root_nwo | clerk/javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 88808b1fae5ab8a526a73e7ce5542a10eb9d6971 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width