Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Jan 20, 2026

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • In-session MFA setup flow: choose authenticator app or SMS, verify, save backup codes, and return to profile. New public TaskSetupMFA component and mounting APIs.
  • Localization

    • Full English strings for MFA setup, verification, success, backup codes, and sign-out.
  • UI Improvements

    • MFA selection & setup screens (QR/URI, phone entry/verification), header badge support, optional animation toggle, and updated backup codes layout.
  • Tests

    • Extensive integration and unit tests covering flows, errors, navigation, and backup codes.
  • Dev/Devops

    • Sandbox route and environment preset for MFA testing.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2026

🦋 Changeset detected

Latest commit: fd76d83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@clerk/tanstack-react-start Minor
@clerk/localizations Minor
@clerk/react-router Minor
@clerk/clerk-js Minor
@clerk/nextjs Minor
@clerk/shared Minor
@clerk/react Minor
@clerk/ui Minor
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/msw Patch
@clerk/nuxt Patch
@clerk/testing Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 30, 2026 1:23am

Request Review

@octoper
Copy link
Member Author

octoper commented Jan 21, 2026

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260121104441
@clerk/astro 3.0.0-snapshot.v20260121104441
@clerk/backend 3.0.0-snapshot.v20260121104441
@clerk/chrome-extension 3.0.0-snapshot.v20260121104441
@clerk/clerk-js 6.0.0-snapshot.v20260121104441
@clerk/dev-cli 1.0.0-snapshot.v20260121104441
@clerk/expo 3.0.0-snapshot.v20260121104441
@clerk/expo-passkeys 1.0.0-snapshot.v20260121104441
@clerk/express 2.0.0-snapshot.v20260121104441
@clerk/fastify 2.6.9-snapshot.v20260121104441
@clerk/localizations 4.0.0-snapshot.v20260121104441
@clerk/msw 0.0.1-snapshot.v20260121104441
@clerk/nextjs 7.0.0-snapshot.v20260121104441
@clerk/nuxt 2.0.0-snapshot.v20260121104441
@clerk/react 6.0.0-snapshot.v20260121104441
@clerk/react-router 3.0.0-snapshot.v20260121104441
@clerk/shared 4.0.0-snapshot.v20260121104441
@clerk/tanstack-react-start 1.0.0-snapshot.v20260121104441
@clerk/testing 2.0.0-snapshot.v20260121104441
@clerk/ui 1.0.0-snapshot.v20260121104441
@clerk/upgrade 2.0.0-snapshot.v20260121104441
@clerk/vue 2.0.0-snapshot.v20260121104441

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260121104441 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.0-snapshot.v20260121104441 --save-exact

@clerk/backend

npm i @clerk/backend@3.0.0-snapshot.v20260121104441 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.0.0-snapshot.v20260121104441 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.0.0-snapshot.v20260121104441 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@1.0.0-snapshot.v20260121104441 --save-exact

@clerk/expo

npm i @clerk/expo@3.0.0-snapshot.v20260121104441 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260121104441 --save-exact

@clerk/express

npm i @clerk/express@2.0.0-snapshot.v20260121104441 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.6.9-snapshot.v20260121104441 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.0.0-snapshot.v20260121104441 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.1-snapshot.v20260121104441 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.0-snapshot.v20260121104441 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.0.0-snapshot.v20260121104441 --save-exact

@clerk/react

npm i @clerk/react@6.0.0-snapshot.v20260121104441 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.0-snapshot.v20260121104441 --save-exact

@clerk/shared

npm i @clerk/shared@4.0.0-snapshot.v20260121104441 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260121104441 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.0-snapshot.v20260121104441 --save-exact

@clerk/ui

npm i @clerk/ui@1.0.0-snapshot.v20260121104441 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.0-snapshot.v20260121104441 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.0-snapshot.v20260121104441 --save-exact

@octoper octoper force-pushed the octoper/setup-mfa-task branch from 4fc95f2 to 61862a2 Compare January 22, 2026 11:04
@octoper
Copy link
Member Author

octoper commented Jan 22, 2026

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260122110524
@clerk/astro 3.0.0-snapshot.v20260122110524
@clerk/backend 3.0.0-snapshot.v20260122110524
@clerk/chrome-extension 3.0.0-snapshot.v20260122110524
@clerk/clerk-js 6.0.0-snapshot.v20260122110524
@clerk/dev-cli 1.0.0-snapshot.v20260122110524
@clerk/expo 3.0.0-snapshot.v20260122110524
@clerk/expo-passkeys 1.0.0-snapshot.v20260122110524
@clerk/express 2.0.0-snapshot.v20260122110524
@clerk/fastify 2.6.9-snapshot.v20260122110524
@clerk/localizations 4.0.0-snapshot.v20260122110524
@clerk/msw 0.0.1-snapshot.v20260122110524
@clerk/nextjs 7.0.0-snapshot.v20260122110524
@clerk/nuxt 2.0.0-snapshot.v20260122110524
@clerk/react 6.0.0-snapshot.v20260122110524
@clerk/react-router 3.0.0-snapshot.v20260122110524
@clerk/shared 4.0.0-snapshot.v20260122110524
@clerk/tanstack-react-start 1.0.0-snapshot.v20260122110524
@clerk/testing 2.0.0-snapshot.v20260122110524
@clerk/ui 1.0.0-snapshot.v20260122110524
@clerk/upgrade 2.0.0-snapshot.v20260122110524
@clerk/vue 2.0.0-snapshot.v20260122110524

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260122110524 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.0-snapshot.v20260122110524 --save-exact

@clerk/backend

npm i @clerk/backend@3.0.0-snapshot.v20260122110524 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.0.0-snapshot.v20260122110524 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.0.0-snapshot.v20260122110524 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@1.0.0-snapshot.v20260122110524 --save-exact

@clerk/expo

npm i @clerk/expo@3.0.0-snapshot.v20260122110524 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260122110524 --save-exact

@clerk/express

npm i @clerk/express@2.0.0-snapshot.v20260122110524 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.6.9-snapshot.v20260122110524 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.0.0-snapshot.v20260122110524 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.1-snapshot.v20260122110524 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.0-snapshot.v20260122110524 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.0.0-snapshot.v20260122110524 --save-exact

@clerk/react

npm i @clerk/react@6.0.0-snapshot.v20260122110524 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.0-snapshot.v20260122110524 --save-exact

@clerk/shared

npm i @clerk/shared@4.0.0-snapshot.v20260122110524 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260122110524 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.0-snapshot.v20260122110524 --save-exact

@clerk/ui

npm i @clerk/ui@1.0.0-snapshot.v20260122110524 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.0-snapshot.v20260122110524 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.0-snapshot.v20260122110524 --save-exact

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Adds a new session task key setup-mfa and implements end-to-end MFA setup: new Clerk mount/unmount APIs and TaskSetupMFAProps, isomorphic premount support, React UI components and flows for TOTP and SMS, session-task routing, contexts and HOCs, lazy loading and appearance keys, localization entries (en-US), MFA utilities, unit and Playwright integration tests, an env preset and long-running app entry, session-task route mapping, and related type and UI prop updates.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: introducing a setup MFA session task across clerk-js and ui packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/ui/src/components/UserProfile/MfaBackupCodeList.tsx (1)

117-138: Inconsistent button padding across action buttons.

The Download button uses t.space.$0x25 (line 119) while Print and Copy buttons use t.space.$2 (lines 127, 135). This will cause visual inconsistency in the button row.

🔧 Proposed fix for consistent padding
          <Button
            variant='ghost'
-           sx={t => ({ width: '100%', padding: `${t.space.$0x25} 0`, borderRadius: 0 })}
+           sx={t => ({ width: '100%', padding: `${t.space.$2} 0`, borderRadius: 0 })}
            onClick={onDownloadTxtFile}
          >
🤖 Fix all issues with AI agents
In `@packages/localizations/src/en-US.ts`:
- Around line 911-913: The title string in the smsCode localization object uses
inconsistent casing ("Add sms code verification"); update the smsCode.title
value to use "SMS" uppercase to match other entries (e.g., change to "Add SMS
code verification") so the smsCode object’s title aligns with smsCode.subtitle
and the other keys like the "SMS code verification enabled" entry.

In `@packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/constants.ts`:
- Around line 1-3: The type for MFA_METHODS_TO_STEP is using Partial
incorrectly; replace Record<Partial<'phone_code' | 'totp'>, number> with a
direct union key type like Record<'phone_code' | 'totp', number> (or if keys
should be optional use Partial<Record<'phone_code' | 'totp', number>>), updating
the MFA_METHODS_TO_STEP constant's type accordingly.

In `@packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/index.tsx`:
- Around line 24-38: The filter mistakenly runs when user.enterpriseAccounts is
undefined (non-enterprise users), causing firstEnterpriseConnection to be
undefined and phone_code to be excluded; update the early-return in
secondFactorsAvailableToAdd so it returns availableMethods when
enterpriseAccounts is missing or empty (e.g., change the condition in the if
that currently checks user?.enterpriseAccounts && user.enterpriseAccounts.length
=== 0 to check for !user?.enterpriseAccounts || user.enterpriseAccounts.length
=== 0) so getSecondFactorsAvailableToAdd(attributes, user) is used for
non-enterprise users.

In `@packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/shared.tsx`:
- Around line 25-30: The multi-session sign-out path in handleSignOut calls
clerk.signOut(..., { sessionId: session?.id }) without ensuring session exists;
update handleSignOut to explicitly check that session is defined before passing
session.id (e.g., if otherSessions.length > 0 then if (!session) handle the edge
case by either falling back to a global signOut call or returning/logging an
error), or add a clear comment documenting that passing undefined sessionId is
intentional and expected; reference handleSignOut, otherSessions, clerk.signOut,
and session?.id when making the change.

In
`@packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/TOTPCodeFlowScreen.tsx`:
- Around line 49-62: The effect in TaskSetupMfa/TOTPCodeFlowScreen currently
runs unconditionally and calls createTOTP() before the Clerk user is guaranteed
to exist, causing the flow to stall; update the React.useEffect that calls
createTOTP() (and the related AddAuthenticatorApp render path) to bail out until
useUser() returns a truthy user (i.e., add a guard "if (!user) return;" and
include user in the effect dependency array) so it re-runs when the user becomes
available, and similarly protect any code that does
user?.verifyTOTP(...).then(...) (in VerifyTOTP) by checking for a defined user
or the verifyTOTP result before calling .then() (or by awaiting inside an async
block only when user is present) to avoid calling .then() on undefined and
ensure the loader can proceed or retry.

In `@packages/ui/src/types.ts`:
- Line 29: Remove the unused `Ref` type from the import statement (currently
"import type { MutableRefObject, Ref } from 'react';") so only
`MutableRefObject` is imported; update the import to drop `Ref` and run
typechecking/linting to ensure no other usages remain (the only referenced
symbol in this file is `MutableRefObject` around the ref usage).

In `@packages/ui/src/utils/mfa.ts`:
- Around line 8-11: The loop over Object.entries(attributes) can throw if an
attribute value is null/undefined; update the iteration in the block that
references attr, used_for_second_factor, and second_factors to guard against
nullish attr and non-array second_factors (e.g., check attr != null and
attr.used_for_second_factor truthiness, and only spread attr.second_factors if
it's an array or fallback to an empty array). This ensures
secondFactors.push(...) is only called with a safe iterable.
🧹 Nitpick comments (1)
packages/ui/src/elements/VerificationCodeCard.tsx (1)

63-67: Minor: Redundant ternary expression.

The ternary on line 66 is redundant since a falsy value would already work as undefined for the onClick handler.

♻️ Optional simplification
        <IdentityPreview
          identifier={props.safeIdentifier}
          avatarUrl={props.profileImageUrl}
-         onClick={props.onIdentityPreviewEditClicked ? props.onIdentityPreviewEditClicked : undefined}
+         onClick={props.onIdentityPreviewEditClicked}
        />

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@integration/tests/session-tasks-setup-mfa.test.ts`:
- Around line 29-30: The test references userIdsToBeDeleted but it is never
declared, causing a runtime ReferenceError; declare and initialize
userIdsToBeDeleted as an array (e.g., let userIdsToBeDeleted: string[] = []) in
the test file scope before tests run, push bapiUser.id into that array where
createBapiUser is called, and add an afterAll cleanup that iterates over
userIdsToBeDeleted to delete created users (using the same users service) to
ensure proper teardown.

@octoper
Copy link
Member Author

octoper commented Jan 28, 2026

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260128194144
@clerk/astro 3.0.0-snapshot.v20260128194144
@clerk/backend 3.0.0-snapshot.v20260128194144
@clerk/chrome-extension 3.0.0-snapshot.v20260128194144
@clerk/clerk-js 6.0.0-snapshot.v20260128194144
@clerk/dev-cli 1.0.0-snapshot.v20260128194144
@clerk/expo 3.0.0-snapshot.v20260128194144
@clerk/expo-passkeys 1.0.0-snapshot.v20260128194144
@clerk/express 2.0.0-snapshot.v20260128194144
@clerk/fastify 2.7.0-snapshot.v20260128194144
@clerk/localizations 4.0.0-snapshot.v20260128194144
@clerk/msw 0.0.1-snapshot.v20260128194144
@clerk/nextjs 7.0.0-snapshot.v20260128194144
@clerk/nuxt 2.0.0-snapshot.v20260128194144
@clerk/react 6.0.0-snapshot.v20260128194144
@clerk/react-router 3.0.0-snapshot.v20260128194144
@clerk/shared 4.0.0-snapshot.v20260128194144
@clerk/tanstack-react-start 1.0.0-snapshot.v20260128194144
@clerk/testing 2.0.0-snapshot.v20260128194144
@clerk/ui 1.0.0-snapshot.v20260128194144
@clerk/upgrade 2.0.0-snapshot.v20260128194144
@clerk/vue 2.0.0-snapshot.v20260128194144

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260128194144 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.0-snapshot.v20260128194144 --save-exact

@clerk/backend

npm i @clerk/backend@3.0.0-snapshot.v20260128194144 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.0.0-snapshot.v20260128194144 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.0.0-snapshot.v20260128194144 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@1.0.0-snapshot.v20260128194144 --save-exact

@clerk/expo

npm i @clerk/expo@3.0.0-snapshot.v20260128194144 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260128194144 --save-exact

@clerk/express

npm i @clerk/express@2.0.0-snapshot.v20260128194144 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.7.0-snapshot.v20260128194144 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.0.0-snapshot.v20260128194144 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.1-snapshot.v20260128194144 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.0-snapshot.v20260128194144 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.0.0-snapshot.v20260128194144 --save-exact

@clerk/react

npm i @clerk/react@6.0.0-snapshot.v20260128194144 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.0-snapshot.v20260128194144 --save-exact

@clerk/shared

npm i @clerk/shared@4.0.0-snapshot.v20260128194144 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260128194144 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.0-snapshot.v20260128194144 --save-exact

@clerk/ui

npm i @clerk/ui@1.0.0-snapshot.v20260128194144 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.0-snapshot.v20260128194144 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.0-snapshot.v20260128194144 --save-exact

@octoper
Copy link
Member Author

octoper commented Jan 29, 2026

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260129231425
@clerk/astro 3.0.0-snapshot.v20260129231425
@clerk/backend 3.0.0-snapshot.v20260129231425
@clerk/chrome-extension 3.0.0-snapshot.v20260129231425
@clerk/clerk-js 6.0.0-snapshot.v20260129231425
@clerk/dev-cli 1.0.0-snapshot.v20260129231425
@clerk/expo 3.0.0-snapshot.v20260129231425
@clerk/expo-passkeys 1.0.0-snapshot.v20260129231425
@clerk/express 2.0.0-snapshot.v20260129231425
@clerk/fastify 2.7.0-snapshot.v20260129231425
@clerk/localizations 4.0.0-snapshot.v20260129231425
@clerk/msw 0.0.1-snapshot.v20260129231425
@clerk/nextjs 7.0.0-snapshot.v20260129231425
@clerk/nuxt 2.0.0-snapshot.v20260129231425
@clerk/react 6.0.0-snapshot.v20260129231425
@clerk/react-router 3.0.0-snapshot.v20260129231425
@clerk/shared 4.0.0-snapshot.v20260129231425
@clerk/tanstack-react-start 1.0.0-snapshot.v20260129231425
@clerk/testing 2.0.0-snapshot.v20260129231425
@clerk/ui 1.0.0-snapshot.v20260129231425
@clerk/upgrade 2.0.0-snapshot.v20260129231425
@clerk/vue 2.0.0-snapshot.v20260129231425

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260129231425 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.0-snapshot.v20260129231425 --save-exact

@clerk/backend

npm i @clerk/backend@3.0.0-snapshot.v20260129231425 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.0.0-snapshot.v20260129231425 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.0.0-snapshot.v20260129231425 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@1.0.0-snapshot.v20260129231425 --save-exact

@clerk/expo

npm i @clerk/expo@3.0.0-snapshot.v20260129231425 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260129231425 --save-exact

@clerk/express

npm i @clerk/express@2.0.0-snapshot.v20260129231425 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.7.0-snapshot.v20260129231425 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.0.0-snapshot.v20260129231425 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.1-snapshot.v20260129231425 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.0-snapshot.v20260129231425 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.0.0-snapshot.v20260129231425 --save-exact

@clerk/react

npm i @clerk/react@6.0.0-snapshot.v20260129231425 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.0-snapshot.v20260129231425 --save-exact

@clerk/shared

npm i @clerk/shared@4.0.0-snapshot.v20260129231425 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260129231425 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.0-snapshot.v20260129231425 --save-exact

@clerk/ui

npm i @clerk/ui@1.0.0-snapshot.v20260129231425 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.0-snapshot.v20260129231425 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.0-snapshot.v20260129231425 --save-exact

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/ui/src/components/SessionTasks/index.tsx`:
- Line 58: The ref currentTaskContainer created via useRef<HTMLDivElement>(null)
in SessionTasks is never attached to a DOM node, so currentTaskContainer.current
is always null and accessing offsetHeight yields undefined; either attach this
ref to the DOM element you intend to measure (e.g., add
ref={currentTaskContainer} to the task container div that represents the
"current/previous task" so the offsetHeight read (used to compute minHeight)
becomes valid) or remove the ref and the related minHeight computation entirely
(delete currentTaskContainer, its useRef import, and any code that reads
currentTaskContainer.current.offsetHeight).

In `@packages/ui/src/contexts/components/SessionTasks.ts`:
- Around line 60-62: The constructed navigation path can create a double-slash
when VIRTUAL_ROUTER_BASE_PATH is used and startPath begins with a slash; update
the branch in SessionTasks (the block that checks VIRTUAL_ROUTER_BASE_PATH and
calls navigate) to normalize components before building the URL—either strip a
leading slash from startPath (or trailing slash from basePath) or use a small
path-join helper to concatenate basePath, startPath, and taskEndpoint so
navigate receives a single-clean path (referencing VIRTUAL_ROUTER_BASE_PATH,
startPath, taskEndpoint, and navigate).
🧹 Nitpick comments (2)
packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/SmsCodeFlowScreen.tsx (1)

72-74: Missing dependency array entries in useEffect.

The effect references prepare which is defined inline and not memoized. While this works for the initial mount pattern, adding prepare or using useCallback would align with React best practices and avoid stale closure issues if the component re-renders.

packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/TOTPCodeFlowScreen.tsx (1)

271-271: Minor: Comment says "Step 3" but index is 2.

The comment at line 271 says "Step 3" but the wizard step index is 2 (0-indexed). This is a cosmetic inconsistency.

Comment on lines +60 to +62
if (basePath === VIRTUAL_ROUTER_BASE_PATH) {
return navigate(`/${basePath + startPath + taskEndpoint}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Potential double-slash in constructed path.

When basePath is VIRTUAL_ROUTER_BASE_PATH and startPath already starts with /, the constructed path /${basePath + startPath + taskEndpoint} could result in malformed paths with double slashes (e.g., /virtual//start/endpoint).

Consider normalizing the path or verifying that startPath handling is consistent:

🛡️ Proposed fix
     if (basePath === VIRTUAL_ROUTER_BASE_PATH) {
-      return navigate(`/${basePath + startPath + taskEndpoint}`);
+      const normalizedPath = `/${basePath}${startPath}${taskEndpoint}`.replace(/\/+/g, '/');
+      return navigate(normalizedPath);
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (basePath === VIRTUAL_ROUTER_BASE_PATH) {
return navigate(`/${basePath + startPath + taskEndpoint}`);
}
if (basePath === VIRTUAL_ROUTER_BASE_PATH) {
const normalizedPath = `/${basePath}${startPath}${taskEndpoint}`.replace(/\/+/g, '/');
return navigate(normalizedPath);
}
🤖 Prompt for AI Agents
In `@packages/ui/src/contexts/components/SessionTasks.ts` around lines 60 - 62,
The constructed navigation path can create a double-slash when
VIRTUAL_ROUTER_BASE_PATH is used and startPath begins with a slash; update the
branch in SessionTasks (the block that checks VIRTUAL_ROUTER_BASE_PATH and calls
navigate) to normalize components before building the URL—either strip a leading
slash from startPath (or trailing slash from basePath) or use a small path-join
helper to concatenate basePath, startPath, and taskEndpoint so navigate receives
a single-clean path (referencing VIRTUAL_ROUTER_BASE_PATH, startPath,
taskEndpoint, and navigate).

@octoper
Copy link
Member Author

octoper commented Jan 30, 2026

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260130165100
@clerk/astro 3.0.0-snapshot.v20260130165100
@clerk/backend 3.0.0-snapshot.v20260130165100
@clerk/chrome-extension 3.0.0-snapshot.v20260130165100
@clerk/clerk-js 6.0.0-snapshot.v20260130165100
@clerk/dev-cli 1.0.0-snapshot.v20260130165100
@clerk/expo 3.0.0-snapshot.v20260130165100
@clerk/expo-passkeys 1.0.0-snapshot.v20260130165100
@clerk/express 2.0.0-snapshot.v20260130165100
@clerk/fastify 2.7.0-snapshot.v20260130165100
@clerk/localizations 4.0.0-snapshot.v20260130165100
@clerk/msw 0.0.1-snapshot.v20260130165100
@clerk/nextjs 7.0.0-snapshot.v20260130165100
@clerk/nuxt 2.0.0-snapshot.v20260130165100
@clerk/react 6.0.0-snapshot.v20260130165100
@clerk/react-router 3.0.0-snapshot.v20260130165100
@clerk/shared 4.0.0-snapshot.v20260130165100
@clerk/tanstack-react-start 1.0.0-snapshot.v20260130165100
@clerk/testing 2.0.0-snapshot.v20260130165100
@clerk/ui 1.0.0-snapshot.v20260130165100
@clerk/upgrade 2.0.0-snapshot.v20260130165100
@clerk/vue 2.0.0-snapshot.v20260130165100

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260130165100 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.0-snapshot.v20260130165100 --save-exact

@clerk/backend

npm i @clerk/backend@3.0.0-snapshot.v20260130165100 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.0.0-snapshot.v20260130165100 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.0.0-snapshot.v20260130165100 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@1.0.0-snapshot.v20260130165100 --save-exact

@clerk/expo

npm i @clerk/expo@3.0.0-snapshot.v20260130165100 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260130165100 --save-exact

@clerk/express

npm i @clerk/express@2.0.0-snapshot.v20260130165100 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.7.0-snapshot.v20260130165100 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.0.0-snapshot.v20260130165100 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.1-snapshot.v20260130165100 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.0-snapshot.v20260130165100 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.0.0-snapshot.v20260130165100 --save-exact

@clerk/react

npm i @clerk/react@6.0.0-snapshot.v20260130165100 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.0-snapshot.v20260130165100 --save-exact

@clerk/shared

npm i @clerk/shared@4.0.0-snapshot.v20260130165100 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260130165100 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.0-snapshot.v20260130165100 --save-exact

@clerk/ui

npm i @clerk/ui@1.0.0-snapshot.v20260130165100 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.0-snapshot.v20260130165100 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.0-snapshot.v20260130165100 --save-exact

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants