Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Nov 20, 2025

Description

This PR introduces the new reset-password session task

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

    • Reset Password session task: end-to-end UI for resetting passwords, optional “sign out of other sessions”, guarded routing, and new localized labels.
  • Tests

    • New test suite validating rendering, password validation, submission flow, identifier display, and sign-out interactions.
  • Chores

    • Minor package version bumps and increased bundle size allowance.

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: 5f8bf0c

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

This PR includes changesets to release 22 packages
Name Type
@clerk/localizations Minor
@clerk/clerk-js Minor
@clerk/shared Minor
@clerk/clerk-react Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/types 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 Nov 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Nov 25, 2025 11:49am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Walkthrough

Adds a "reset-password" session task: route mapping, TaskResetPassword component with guard and context, types and localization entries across locales, tests and fixture updates, a changeset, and an increased bundlewatch limit for the sessionTasks bundle.

Changes

Cohort / File(s) Summary
Changeset
/.changeset/loose-brooms-occur.md
Adds changeset documenting minor version bumps and new reset-password session task.
Core session routing
packages/clerk-js/src/core/sessionTasks.ts
Added 'reset-password': 'reset-password' to INTERNAL_SESSION_TASK_ROUTE_BY_KEY.
SessionTasks entry & exports
packages/clerk-js/src/ui/components/SessionTasks/index.tsx
Registers TaskResetPassword route, provides TaskResetPasswordContext.Provider, updates router matches/redirect logic, and exports related context.
TaskResetPassword UI
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx
New TaskResetPasswordInternal and public wrapper: password fields, validation, reverification-based update flow, optional "sign out of other sessions", error-to-field mapping; exported wrapped with guards and card state provider.
TaskResetPassword HOC guard
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts
New withTaskGuard HOC that redirects when the current task is absent, resolves redirect URLs, and emits a cannotRenderComponentWhenTaskDoesNotExist warning.
TaskChooseOrganization import fix
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
Adjusted withTaskGuard import path to sibling ./withTaskGuard.
SessionTasks contexts & provider wiring
packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx, packages/clerk-js/src/ui/contexts/components/SessionTasks.ts
Added TaskResetPasswordContext, useTaskResetPasswordContext, and wired provider case into ComponentContextProvider.
UI metadata / flow
packages/clerk-js/src/ui/elements/contexts/index.tsx
Extended FlowMetadata.flow union to include 'taskResetPassword'.
Types — UI & shared
packages/clerk-js/src/ui/types.ts, packages/shared/src/types/clerk.ts, packages/shared/src/types/appearance.ts, packages/shared/src/types/session.ts, packages/shared/src/types/localization.ts
Added TaskResetPasswordProps, TaskResetPasswordCtx, TaskResetPasswordTheme; included context in AvailableComponentCtx; extended SessionTask.key to include 'reset-password'; added localization type entry; JSDoc tweak.
Localization resources
packages/localizations/src/en-US.ts, packages/localizations/src/* (many locales)
Added taskResetPassword localization block (en-US with strings; other locales added placeholder keys set to undefined) including title, signOut (actionLink/actionText), and formButtonPrimary.
Tests & fixtures
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx, packages/clerk-js/src/test/fixture-helpers.ts
New test suite for TaskResetPassword; fixture helper accepts optional identifier and uses it for user identifier.
Bundlewatch config
packages/clerk-js/bundlewatch.config.json
Increased allowed maxSize for dist/sessionTasks*.js from 1.5KB to 3.0KB.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant UI as SessionTasks UI
    participant Ctx as TaskResetPasswordContext
    participant Guard as withTaskGuard
    participant Comp as TaskResetPassword
    participant API as Clerk API

    User->>UI: open session tasks route (/session-tasks/reset-password)
    UI->>Ctx: mount TaskResetPasswordContext (redirectUrlComplete)
    UI->>Guard: render guarded component
    Guard->>Guard: check clerk.session.currentTask == 'reset-password'?
    alt task exists
        Guard->>Comp: render TaskResetPassword
        User->>Comp: enter newPassword, confirmPassword, toggle signOutOfOtherSessions
        Comp->>API: updatePassword (reverification flow) + signOut option
        API-->>Comp: success / error
        alt success
            Comp->>User: show success and redirect (redirectUrlComplete or after-sign-in)
        else error
            Comp->>User: show field errors / card state
        end
    else task missing
        Guard->>User: redirect to sign-in or after-sign-in URL (emit warning)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25–30 minutes

  • Areas to focus:
    • Password update / reverification flow and error-to-field mapping in TaskResetPassword.
    • Redirect and authentication logic in withTaskGuard.
    • Public type additions and their exports (shared types + UI types).
    • Localization additions for consistency across locales.
    • Bundlewatch size increase impact on CI.

Poem

🐇 I found a lost-reset key today,
I hopped through contexts, guards at play,
New passwords queued, confirmations made,
Tests cheered on as errors fade,
A small rabbit nods—hooray! 🥕

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat(clerk-js): Introduce reset password session task' accurately and concisely describes the main feature being added. It follows conventional commit format and clearly highlights the primary change without noise or vagueness.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 76a3342 and 5f8bf0c.

📒 Files selected for processing (2)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx (1 hunks)
  • packages/localizations/src/pt-BR.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/tests/TaskResetPassword.test.tsx
  • packages/localizations/src/pt-BR.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

@octoper
Copy link
Member Author

octoper commented Nov 20, 2025

!snapshot

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.2.3-snapshot.v20251120173355
@clerk/astro 2.16.1-snapshot.v20251120173355
@clerk/backend 2.23.1-snapshot.v20251120173355
@clerk/chrome-extension 2.8.3-snapshot.v20251120173355
@clerk/clerk-js 5.110.0-snapshot.v20251120173355
@clerk/elements 0.23.84-snapshot.v20251120173355
@clerk/clerk-expo 2.19.3-snapshot.v20251120173355
@clerk/expo-passkeys 0.4.20-snapshot.v20251120173355
@clerk/express 1.7.51-snapshot.v20251120173355
@clerk/fastify 2.6.3-snapshot.v20251120173355
@clerk/localizations 3.29.0-snapshot.v20251120173355
@clerk/nextjs 6.35.3-snapshot.v20251120173355
@clerk/nuxt 1.13.1-snapshot.v20251120173355
@clerk/clerk-react 5.56.1-snapshot.v20251120173355
@clerk/react-router 2.2.3-snapshot.v20251120173355
@clerk/remix 4.13.18-snapshot.v20251120173355
@clerk/shared 3.36.0-snapshot.v20251120173355
@clerk/tanstack-react-start 0.27.3-snapshot.v20251120173355
@clerk/testing 1.13.17-snapshot.v20251120173355
@clerk/themes 2.4.38-snapshot.v20251120173355
@clerk/types 4.101.1-snapshot.v20251120173355
@clerk/vue 1.16.1-snapshot.v20251120173355

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

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/elements

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --save-exact

@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from 1b51682 to 9ab72aa Compare November 20, 2025 17:39
@octoper octoper marked this pull request as ready for review November 20, 2025 17:49
@octoper
Copy link
Member Author

octoper commented Nov 20, 2025

!snapshot

subtitle: 'Enter the password associated with your account',
title: 'Enter your password',
},
passwordPwned: {
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment for the reviewers: I will generate the localizations before merging the PR

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.2.3-snapshot.v20251120175123
@clerk/astro 2.16.1-snapshot.v20251120175123
@clerk/backend 2.23.1-snapshot.v20251120175123
@clerk/chrome-extension 2.8.3-snapshot.v20251120175123
@clerk/clerk-js 5.110.0-snapshot.v20251120175123
@clerk/elements 0.23.84-snapshot.v20251120175123
@clerk/clerk-expo 2.19.3-snapshot.v20251120175123
@clerk/expo-passkeys 0.4.20-snapshot.v20251120175123
@clerk/express 1.7.51-snapshot.v20251120175123
@clerk/fastify 2.6.3-snapshot.v20251120175123
@clerk/localizations 3.29.0-snapshot.v20251120175123
@clerk/nextjs 6.35.3-snapshot.v20251120175123
@clerk/nuxt 1.13.1-snapshot.v20251120175123
@clerk/clerk-react 5.56.1-snapshot.v20251120175123
@clerk/react-router 2.2.3-snapshot.v20251120175123
@clerk/remix 4.13.18-snapshot.v20251120175123
@clerk/shared 3.36.0-snapshot.v20251120175123
@clerk/tanstack-react-start 0.27.3-snapshot.v20251120175123
@clerk/testing 1.13.17-snapshot.v20251120175123
@clerk/themes 2.4.38-snapshot.v20251120175123
@clerk/types 4.101.1-snapshot.v20251120175123
@clerk/vue 1.16.1-snapshot.v20251120175123

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

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/elements

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --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: 1

🧹 Nitpick comments (2)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts (1)

1-26: withTaskGuard implementation matches existing session task guard semantics

The guard correctly:

  • Checks for absence of clerk.session?.currentTask and redirects either to buildSignInUrl() (no session) or ctx.redirectUrlComplete ?? clerk.buildAfterSignInUrl().
  • Reuses withRedirect and warning cannotRenderComponentWhenTaskDoesNotExist.
  • Preserves component displayName, consistent with the TaskChooseOrganization guard.

One thing to double‑check: ensure TaskResetPasswordProps has been added to AvailableComponentProps, otherwise withTaskGuard(TaskResetPassword) will fail the P extends AvailableComponentProps constraint.

If more task-specific guards are added in the future, consider extracting a shared helper that takes the task context hook as a parameter to avoid near-identical HOCs.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)

128-128: Consider using configured password settings for minLength.

The minLength={6} is hardcoded, but passwordSettings is available from the environment context. While the validatePassword flag on the field already uses password settings for validation, aligning the HTML5 minLength attribute with the configured minimum would provide more consistent user feedback.

Consider using:

                    <Form.PasswordInput
                      {...passwordField.props}
                      isRequired
-                      minLength={6}
+                      minLength={passwordSettings.min_length}
                    />
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 77e022f and 9ab72aa.

📒 Files selected for processing (16)
  • .changeset/loose-brooms-occur.md (1 hunks)
  • packages/clerk-js/src/core/sessionTasks.ts (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts (1 hunks)
  • packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (2 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/types.ts (3 hunks)
  • packages/localizations/src/en-US.ts (2 hunks)
  • packages/shared/src/types/appearance.ts (1 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
  • packages/shared/src/types/localization.ts (2 hunks)
  • packages/shared/src/types/session.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx (2)
packages/clerk-js/src/test/create-fixtures.tsx (1)
  • bindCreateFixtures (28-35)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)
  • TaskResetPassword (186-188)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (3)
packages/clerk-js/src/core/sessionTasks.ts (1)
  • INTERNAL_SESSION_TASK_ROUTE_BY_KEY (9-12)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (1)
  • TaskResetPasswordContext (31-31)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)
  • TaskResetPassword (186-188)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (5)
packages/clerk-js/src/ui/elements/contexts/index.tsx (2)
  • useCardState (42-70)
  • withCardStateProvider (72-81)
packages/clerk-js/src/ui/utils/passwordUtils.ts (1)
  • createPasswordError (33-74)
packages/clerk-js/src/ui/hooks/usePassword.ts (1)
  • useConfirmPassword (77-110)
packages/clerk-js/src/ui/utils/errorHandler.ts (1)
  • handleError (64-86)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts (1)
  • withTaskGuard (8-26)
packages/shared/src/types/clerk.ts (1)
packages/shared/src/types/appearance.ts (1)
  • TaskResetPasswordTheme (1044-1044)
packages/clerk-js/src/ui/types.ts (1)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2222-2228)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (1)
packages/clerk-js/src/ui/types.ts (1)
  • TaskResetPasswordCtx (155-157)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts (4)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/withTaskGuard.ts (1)
  • withTaskGuard (8-26)
packages/clerk-js/src/ui/types.ts (1)
  • AvailableComponentProps (46-63)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (1)
  • useTaskResetPasswordContext (33-41)
packages/clerk-js/src/ui/common/withRedirect.tsx (1)
  • withRedirect (16-53)
packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx (2)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (1)
  • TaskResetPasswordContext (31-31)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2222-2228)
🔇 Additional comments (16)
packages/shared/src/types/appearance.ts (1)

1044-1044: TaskResetPasswordTheme alias is consistent with existing theme types

The new TaskResetPasswordTheme alias mirrors the pattern used for other component themes and keeps the public API consistent. No issues from a typing or compatibility perspective.

.changeset/loose-brooms-occur.md (1)

1-7: Changeset scope and bump levels look appropriate

The changeset correctly scopes the reset-password session task work to @clerk/clerk-js, @clerk/shared, and @clerk/localizations with minor bumps, matching the feature-level change.

packages/clerk-js/src/ui/elements/contexts/index.tsx (1)

83-105: FlowMetadata extended correctly for new task flows

Adding 'taskChooseOrganization' and 'taskResetPassword' to FlowMetadata.flow aligns with the new session task routes and existing usages like <Flow.Root flow='taskChooseOrganization'>. The union remains coherent and backward compatible.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)

11-11: Import path adjustment aligns with new task-local guard structure

Switching withTaskGuard to a sibling import ('./withTaskGuard') matches the new pattern where each session task owns its own guard implementation. The wrapping at the export site remains unchanged and correct.

packages/shared/src/types/clerk.ts (1)

2222-2228: LGTM! TaskResetPasswordProps follows established patterns.

The type definition correctly mirrors the structure of TaskChooseOrganizationProps, with appropriate fields for navigation and theming. The JSDoc comment clearly documents the purpose of the redirectUrlComplete field.

packages/clerk-js/src/core/sessionTasks.ts (1)

9-12: LGTM! Route mapping correctly added.

The new 'reset-password' entry follows the existing pattern and integrates properly with the SessionTask['key'] type union. This will enable proper URL building via getTaskEndpoint and buildTaskUrl functions.

packages/clerk-js/src/ui/components/SessionTasks/index.tsx (1)

65-71: LGTM! Route and context setup correctly implemented.

The new reset-password route follows the established pattern from the choose-organization task. The context provider properly passes componentName and redirectUrlComplete to the TaskResetPassword component.

packages/clerk-js/src/ui/types.ts (1)

155-157: LGTM! Context type properly defined.

The TaskResetPasswordCtx type correctly extends TaskResetPasswordProps and adds the required componentName literal, following the established pattern for component contexts.

packages/localizations/src/en-US.ts (1)

866-872: LGTM! Localization strings properly structured.

The taskResetPassword localization keys follow the same pattern as taskChooseOrganization, providing clear user-facing strings for the title and sign-out action. The {{identifier}} placeholder correctly enables dynamic user information display.

packages/shared/src/types/localization.ts (1)

1290-1296: LGTM! Localization types correctly defined.

The taskResetPassword type definition properly mirrors the structure in en-US.ts, with correctly typed LocalizationValue fields. The actionText field appropriately uses LocalizationValue<'identifier'> to enable type-safe interpolation of the user identifier.

packages/shared/src/types/session.ts (2)

338-338: LGTM! SessionTask key union properly extended.

The key field now correctly includes both 'choose-organization' and 'reset-password', enabling type-safe handling of the new task type throughout the session management system.


38-40: Nice documentation improvement.

The JSDoc @default true annotation clarifies the default behavior of treatPendingAsSignedOut, improving the developer experience.

packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx (1)

130-137: LGTM! Context provider case correctly implemented.

The TaskResetPassword case follows the established pattern, properly typing the props and providing the context value with the correct componentName literal. The implementation is consistent with the TaskChooseOrganization case.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx (1)

1-103: LGTM! Comprehensive test coverage.

The test suite provides excellent coverage of the TaskResetPassword component, including:

  • Guard behavior (rendering only when task exists)
  • Multi-task ordering
  • User identifier display (both email and username)
  • Sign-out interaction flow

The tests are well-structured, use appropriate testing utilities, and have clear assertions.

packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (1)

3-3: LGTM! Consistent context implementation.

The new TaskResetPassword context and hook follow the established pattern used by TaskChooseOrganization. The implementation is consistent with the codebase conventions and includes proper error messaging.

Also applies to: 31-41

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)

186-188: LGTM! Proper HOC composition.

The component export correctly composes three higher-order components:

  • withCoreSessionSwitchGuard for session-level guards
  • withTaskGuard for task existence validation
  • withCardStateProvider for form state management

The order and composition are appropriate for this session task component.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 20, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7268

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7268

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7268

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7268

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7268

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7268

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7268

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7268

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7268

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7268

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7268

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7268

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7268

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7268

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7268

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7268

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7268

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7268

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7268

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7268

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7268

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7268

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7268

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7268

commit: 5f8bf0c

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

🧹 Nitpick comments (2)
packages/localizations/src/en-US.ts (1)

863-869: Confirm copy consistency with existing reset-password flows

The new taskResetPassword strings look fine and match the type, but the title here ('Reset password') differs from signIn.resetPassword.title ('Set new password'). If these flows are meant to feel like the same step, consider reusing or aligning the wording for consistency; otherwise, leaving them distinct is also reasonable.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)

74-90: Use card state’s async helpers to manage loading and double-submits

resetPassword runs the async reverification/password update without going through card.runAsync or updating card loading state, so the UI can’t reflect an in-flight submission and users may trigger multiple requests by clicking rapidly.

It would be more consistent with other flows to wrap the operation with the card state helper and/or disable the submit button while a request is in progress, e.g. by using card.runAsync and adding card.isLoading into the Form.SubmitButton’s disabled condition.

Also applies to: 107-113, 147-151

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9ab72aa and 29759c4.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1 hunks)
  • packages/localizations/src/en-US.ts (1 hunks)
  • packages/shared/src/types/localization.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (5)
packages/clerk-js/src/ui/elements/contexts/index.tsx (2)
  • useCardState (42-70)
  • withCardStateProvider (72-81)
packages/clerk-js/src/ui/utils/passwordUtils.ts (1)
  • createPasswordError (33-74)
packages/clerk-js/src/ui/hooks/usePassword.ts (1)
  • useConfirmPassword (77-110)
packages/clerk-js/src/ui/utils/errorHandler.ts (1)
  • handleError (64-86)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/withTaskGuard.ts (1)
  • withTaskGuard (8-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/shared/src/types/localization.ts (1)

1287-1293: taskResetPassword localization shape is consistent and correctly typed

The new taskResetPassword block (title + signOut.actionLink/actionText<'identifier'>) aligns with how it’s used in the UI and with the en-US resource; the interpolation parameter choice looks correct.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/index.tsx (1)

92-177: Overall TaskResetPassword wiring, localization, and sign-out behavior look solid

The component correctly derives the identifier for display, uses the new taskResetPassword.* localization keys, integrates reverification-based password updates, and handles multi-session sign-out via useMultipleSessions + sign-out context in a way that matches existing patterns.

@LauraBeatris
Copy link
Member

Let's also add some integration tests for the main flow + unit tests for the task component itself

@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from 29759c4 to 3a52a51 Compare November 24, 2025 09:09
@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from 69bb063 to f7c2635 Compare November 24, 2025 14:16
@octoper
Copy link
Member Author

octoper commented Nov 24, 2025

@LauraBeatris I've added more unit tests, we will have to add integration tests on an upcoming PR

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

🧹 Nitpick comments (20)
packages/localizations/src/is-IS.ts (1)

866-873: taskResetPassword block structure looks correct and consistent

The taskResetPassword group matches the existing localization patterns (shape and undefined placeholders) used elsewhere in this file and across locales, so this is structurally safe. Once proper Icelandic translations are available, consider replacing the undefined values to avoid fallback English strings leaking into the reset-password flow.

packages/localizations/src/hu-HU.ts (1)

863-870: taskResetPassword block shape looks correct and consistent

The new taskResetPassword keys mirror the structure of other session task blocks (including nested signOut) and should integrate cleanly with the new task without type or runtime issues, even with values left as undefined for fallback behavior. If you’d like to improve the Hungarian coverage, we can add proper translations here in a follow‑up or I can propose initial strings now.

packages/localizations/src/kk-KZ.ts (1)

856-863: taskResetPassword localization block is structurally correct

The new taskResetPassword entry matches the expected schema and neighboring patterns (e.g., taskChooseOrganization), so it should integrate cleanly. Since this locale already uses many undefined placeholders, leaving these keys untranslated is acceptable, though you may want to fill in Kazakh strings later to keep the UX consistent.

packages/localizations/src/ro-RO.ts (1)

877-884: taskResetPassword block structure looks correct

The new taskResetPassword localization block matches the expected shape and is consistent with how this file uses undefined placeholders for untranslated strings. Once the Romanian copy is ready, you can safely replace these undefined values with actual translations; until then, fallback behavior should work as for other keys.

packages/localizations/src/ru-RU.ts (1)

876-883: taskResetPassword shape looks correct; consider reusing existing Russian reset-password copy

The new taskResetPassword block matches the expected structure (button, signOut, title) and is consistent with how other untranslated keys are left as undefined in this community locale, so type-wise this is fine. As an optional improvement, you might reuse the existing Russian strings from signIn.resetPassword for formButtonPrimary/title here to avoid falling back to the default locale or showing empty labels when this task UI is rendered.

packages/localizations/src/pl-PL.ts (1)

869-876: LGTM! Structure is correct and consistent with file pattern.

The new taskResetPassword localization cluster is properly structured with all required keys. While all values are currently undefined, this is consistent with the community-maintained nature of this file as stated in the disclaimer (lines 1-11) and matches the pattern used throughout the file where many sections remain untranslated.

Future improvement: Consider providing Polish translations for these keys in a follow-up to complete the localization for the reset password task.

packages/localizations/src/ms-MY.ts (1)

872-879: Structure is correct; translations pending.

The taskResetPassword localization section has been added with the correct structure, matching the pattern of other task sections in this file. All values are currently undefined, which is consistent with this being a community-contributed locale file where many translations remain incomplete.

The application will handle these undefined values appropriately (typically falling back to the default locale).

If Malay translations become available in the future, consider populating these keys:

  • formButtonPrimary - primary button text for the reset password form
  • signOut.actionLink and signOut.actionText - sign out action labels
  • title - screen title for the reset password task
packages/localizations/src/it-IT.ts (1)

872-879: taskResetPassword block shape looks correct

The new taskResetPassword block is placed correctly after taskChooseOrganization, matches the expected key structure (formButtonPrimary, nested signOut, title), and preserves object syntax. Values being undefined is consistent with other untranslated keys in this locale and will rely on fallback strings until Italian translations are available.

packages/localizations/src/be-BY.ts (1)

869-876: Consistent addition of taskResetPassword localization

The taskResetPassword entry mirrors the structure of taskChooseOrganization and other locales (button label, nested signOut, title), and the object syntax is valid. Using undefined for all strings is consistent with the rest of this community locale and will fall back to the default language until Belarusian translations are provided.

packages/localizations/src/ta-IN.ts (1)

871-878: taskResetPassword block wired correctly for ta‑IN

The new taskResetPassword section is structurally correct (expected keys and nesting, correct commas) and placed alongside other task blocks. Leaving the values undefined is in line with other untranslated surfaces in this locale and will use fallback copy until Tamil translations are supplied.

packages/localizations/src/hi-IN.ts (1)

869-876: Reset‑password task localization hook added cleanly

The taskResetPassword group is correctly shaped (button label, nested signOut, title) and integrated beside existing task localizations. Using undefined placeholders is consistent with other unfinished translations in this community file and will fall back to the base locale until Hindi copy is ready.

packages/localizations/src/sv-SE.ts (1)

867-874: Swedish taskResetPassword locale entry matches shared contract

The new taskResetPassword block is correctly placed and matches the expected key structure (primary button, nested signOut, title). With all values set to undefined, it follows the existing pattern for untranslated strings in this community locale and can later be populated to mirror the semantics of the existing signIn.resetPassword copy.

packages/localizations/src/es-ES.ts (1)

865-872: New taskResetPassword keys wired correctly

The taskResetPassword group is added with the correct keys and nesting. Using undefined placeholders is consistent with other untranslated task blocks in this locale; you can later reuse or adapt the existing signIn.resetPassword strings when you localize this task.

packages/localizations/src/es-MX.ts (1)

872-879: Well-formed taskResetPassword localization block

The new taskResetPassword group is correctly shaped and aligned with other locales. Leaving values undefined is consistent with this community file; later you may want to mirror the existing signIn.resetPassword Spanish (MX) wording here for a more complete experience.

packages/localizations/src/fr-FR.ts (1)

880-887: taskResetPassword block shape is correct and consistent

The new taskResetPassword entry mirrors the existing task structure (taskChooseOrganization) and matches the expected fields for the reset-password task. Using undefined placeholders is consistent with the rest of this community-contributed locale and should keep typings happy while falling back to defaults where applicable. When you have bandwidth, you may want to reuse the existing signIn.resetPassword French copy here instead of undefined to avoid mixed-language UI for this task.

packages/localizations/src/es-CR.ts (1)

871-878: Consistent taskResetPassword structure; consider filling Spanish strings later

The taskResetPassword object is added with the correct shape and in the right place, consistent with other locales and with taskChooseOrganization. Leaving fields as undefined matches the existing pattern for untranslated es-CR keys. As a follow-up, you might want to populate these with Spanish strings aligned to signIn.resetPassword so this task doesn’t partially fall back to another locale at runtime.

packages/localizations/src/bn-IN.ts (1)

869-876: taskResetPassword key added with correct schema

The new taskResetPassword entry matches the expected schema (button, sign-out CTA, title) and follows the existing pattern of using undefined for untranslated bn-IN strings. Once the main flow stabilizes, it would be worth populating these with Bengali copy, likely based on the already-localized signIn.resetPassword block, to keep the reset-password task fully localized.

packages/localizations/src/pt-BR.ts (1)

876-883: Schema looks good; this locale is mature enough to localize now

The taskResetPassword object is structurally correct and aligns with other locales and taskChooseOrganization. Since pt-BR is otherwise very complete and already has signIn.resetPassword strings, you may want to replace these undefined placeholders with Portuguese text now to avoid a mixed-language experience in the new reset-password task.

packages/localizations/src/bg-BG.ts (1)

865-872: Correct addition of taskResetPassword; translations can follow

The new taskResetPassword group uses the same structure as other locales and slots in cleanly after taskChooseOrganization, so typings and routing for the new task will work as expected. Given that signIn.resetPassword is already localized in this file, a nice follow-up would be to copy/adapt that Bulgarian copy here instead of leaving all fields undefined, but that can be done independently of this PR.

packages/localizations/src/mn-MN.ts (1)

864-871: Consider reusing existing reset‑password Mongolian strings for this new task

The object shape for taskResetPassword looks correct, but leaving all fields undefined means this new screen will likely show fallback (probably English) even though you already have Mongolian copy for reset password under signIn.resetPassword. To keep the UX consistent, you can safely reuse those existing strings for the CTA and title:

   taskResetPassword: {
-    formButtonPrimary: undefined,
+    formButtonPrimary: 'Нууц үг сэргээх',
     signOut: {
       actionLink: undefined,
       actionText: undefined,
     },
-    title: undefined,
+    title: 'Шинэ нууц үг тохируулна уу',
   },

If the intent is to keep English fallback until a native speaker reviews the copy, feel free to ignore this suggestion.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f7c2635 and 8c9070e.

📒 Files selected for processing (49)
  • packages/localizations/src/ar-SA.ts (1 hunks)
  • packages/localizations/src/be-BY.ts (1 hunks)
  • packages/localizations/src/bg-BG.ts (1 hunks)
  • packages/localizations/src/bn-IN.ts (1 hunks)
  • packages/localizations/src/ca-ES.ts (1 hunks)
  • packages/localizations/src/cs-CZ.ts (1 hunks)
  • packages/localizations/src/da-DK.ts (1 hunks)
  • packages/localizations/src/de-DE.ts (1 hunks)
  • packages/localizations/src/el-GR.ts (1 hunks)
  • packages/localizations/src/en-GB.ts (1 hunks)
  • packages/localizations/src/en-US.ts (1 hunks)
  • packages/localizations/src/es-CR.ts (1 hunks)
  • packages/localizations/src/es-ES.ts (1 hunks)
  • packages/localizations/src/es-MX.ts (1 hunks)
  • packages/localizations/src/es-UY.ts (1 hunks)
  • packages/localizations/src/fa-IR.ts (1 hunks)
  • packages/localizations/src/fi-FI.ts (1 hunks)
  • packages/localizations/src/fr-FR.ts (1 hunks)
  • packages/localizations/src/he-IL.ts (1 hunks)
  • packages/localizations/src/hi-IN.ts (1 hunks)
  • packages/localizations/src/hr-HR.ts (1 hunks)
  • packages/localizations/src/hu-HU.ts (1 hunks)
  • packages/localizations/src/id-ID.ts (1 hunks)
  • packages/localizations/src/is-IS.ts (1 hunks)
  • packages/localizations/src/it-IT.ts (1 hunks)
  • packages/localizations/src/ja-JP.ts (1 hunks)
  • packages/localizations/src/kk-KZ.ts (1 hunks)
  • packages/localizations/src/ko-KR.ts (1 hunks)
  • packages/localizations/src/mn-MN.ts (1 hunks)
  • packages/localizations/src/ms-MY.ts (1 hunks)
  • packages/localizations/src/nb-NO.ts (1 hunks)
  • packages/localizations/src/nl-BE.ts (1 hunks)
  • packages/localizations/src/nl-NL.ts (1 hunks)
  • packages/localizations/src/pl-PL.ts (1 hunks)
  • packages/localizations/src/pt-BR.ts (1 hunks)
  • packages/localizations/src/pt-PT.ts (1 hunks)
  • packages/localizations/src/ro-RO.ts (1 hunks)
  • packages/localizations/src/ru-RU.ts (1 hunks)
  • packages/localizations/src/sk-SK.ts (1 hunks)
  • packages/localizations/src/sr-RS.ts (1 hunks)
  • packages/localizations/src/sv-SE.ts (1 hunks)
  • packages/localizations/src/ta-IN.ts (1 hunks)
  • packages/localizations/src/te-IN.ts (1 hunks)
  • packages/localizations/src/th-TH.ts (1 hunks)
  • packages/localizations/src/tr-TR.ts (1 hunks)
  • packages/localizations/src/uk-UA.ts (1 hunks)
  • packages/localizations/src/vi-VN.ts (1 hunks)
  • packages/localizations/src/zh-CN.ts (1 hunks)
  • packages/localizations/src/zh-TW.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (27)
packages/localizations/src/ca-ES.ts (1)

864-871: taskResetPassword shape and placement look correct

The new taskResetPassword block matches the expected structure (button label, sign-out link/text, title) and is placed consistently next to taskChooseOrganization. Using undefined placeholders is aligned with this community file’s existing pattern for untranslated keys, so this addition is safe to ship as-is.

packages/localizations/src/fi-FI.ts (1)

865-872: New taskResetPassword localization block matches existing patterns

The added taskResetPassword object has the correct shape (button label, sign‑out actions, title) and is consistent with neighboring task keys and other locales; using undefined placeholders is aligned with how this community locale handles untranslated strings.

packages/localizations/src/hr-HR.ts (1)

866-873: LGTM! Localization structure added correctly.

The new taskResetPassword section follows the established pattern for task-related localization blocks (matching taskChooseOrganization). The undefined values are consistent with this being a community-contributed locale that awaits translation, as noted in the file's disclaimer.

packages/localizations/src/ja-JP.ts (1)

866-873: LGTM! Structure is consistent with existing patterns.

The new taskResetPassword entry is correctly structured and follows the same placeholder pattern used throughout this community-contributed localization file. The undefined values are expected and will need Japanese translations in a future update.

packages/localizations/src/tr-TR.ts (1)

865-872: LGTM! Localization structure follows established pattern.

The new taskResetPassword localization block correctly follows the structure used throughout this community-contributed localization file. The undefined placeholders are consistent with the pattern for untranslated strings, as noted in the file's disclaimer (lines 1-11).

The structure matches the expected shape:

  • formButtonPrimary: button label
  • signOut: nested object with action link and text
  • title: section title

This aligns with how other task localizations (e.g., taskChooseOrganization) are structured in this file.

packages/localizations/src/nb-NO.ts (1)

863-870: LGTM! Consistent structure for community-contributed localization.

The taskResetPassword object follows the established pattern for community-contributed localizations, with all fields properly initialized to undefined to match the type definition while awaiting Norwegian translations. The structure is consistent with similar task objects like taskChooseOrganization and maintains type compatibility with LocalizationResource.

packages/localizations/src/sk-SK.ts (1)

869-876: LGTM! Placeholder entries added correctly.

The new taskResetPassword localization block follows the established pattern for this community-maintained locale. All fields are appropriately set to undefined, consistent with how untranslated keys are handled throughout the file (similar to taskChooseOrganization).

Future translations for these fields should be provided by the Slovak community to complete the localization for the reset-password session task.

packages/localizations/src/te-IN.ts (1)

871-878: LGTM! Consistent with the te-IN locale pattern.

The addition of the taskResetPassword block with undefined values is appropriate for this community-maintained localization file. The structure correctly mirrors other task blocks in this file, and the placeholder values will allow the application to fall back to the default locale for Telugu users until translations are provided.

packages/localizations/src/uk-UA.ts (1)

861-868: LGTM! Structure is correct and consistent with the file.

The new taskResetPassword section is properly structured and syntactically correct. While all fields are set to undefined (meaning no Ukrainian translations are provided yet), this is consistent with the current state of this community-contributed localization file, which has extensive undefined values throughout. The structure correctly provides type safety for the new reset-password session task feature.

packages/localizations/src/fa-IR.ts (1)

875-882: LGTM! Structure follows established pattern.

The addition of the taskResetPassword localization group with undefined placeholders is consistent with the existing pattern throughout this community-maintained file. The structure correctly matches the expected schema (formButtonPrimary, signOut actions, and title), and since this file already contains numerous undefined values for untranslated keys, the consuming code should handle these gracefully.

Note: As this is a community-contributed localization file (per the disclaimer at the top), these placeholders can be filled with Persian translations by community contributors when available.

packages/localizations/src/he-IL.ts (1)

855-862: LGTM! Structure is consistent across all locales.

The taskResetPassword entry in he-IL.ts follows the exact structure used across all 47 locale files in this PR. Only en-US provides actual translations; all other locales use undefined values as placeholders, which is the expected pattern for community-contributed localization files.

packages/localizations/src/el-GR.ts (1)

866-873: taskResetPassword block shape is correct and consistently placed

The new taskResetPassword entry matches the expected key structure and is aligned with how other, untranslated keys are represented in this community locale. No further changes needed here.

packages/localizations/src/sr-RS.ts (1)

862-869: Consistent taskResetPassword localization stub

The added taskResetPassword block has the correct key structure and mirrors the pattern used in other locales for untranslated entries. Looks good.

packages/localizations/src/vi-VN.ts (1)

872-879: vi-VN taskResetPassword entry matches the shared schema

The taskResetPassword block uses the expected keys and is added alongside other task_* sections, matching the cross-locale pattern. No issues.

packages/localizations/src/da-DK.ts (1)

862-869: da-DK taskResetPassword stub is well-formed

The new taskResetPassword localization block has the correct keys and is positioned consistently after taskChooseOrganization. Looks fine as a placeholder for future translations.

packages/localizations/src/zh-TW.ts (1)

852-859: zh-TW gains the required taskResetPassword keys

The added taskResetPassword block matches the expected schema (button label, sign-out actions, title) and aligns with other locales’ additions. No changes requested.

packages/localizations/src/ko-KR.ts (1)

857-864: taskResetPassword structure is correct and consistent

The new taskResetPassword block has the expected shape and matches the surrounding pattern of leaving untranslated strings as undefined in this community locale file. No changes needed.

packages/localizations/src/de-DE.ts (1)

879-886: Correct addition of taskResetPassword group

The new taskResetPassword localization block has the right key names and nesting and is consistent with how other locales define this task. Leaving values undefined is fine until German copy is available.

packages/localizations/src/nl-BE.ts (1)

864-871: taskResetPassword keys added with correct shape

The taskResetPassword block is positioned and structured consistently with other locales and existing task blocks in this file. Using undefined placeholders is acceptable until Dutch (BE) translations are provided.

packages/localizations/src/pt-PT.ts (1)

862-869: taskResetPassword block is structurally correct and consistent

The new taskResetPassword object matches the expected key shape and nesting (button, signOut, title) and is correctly placed alongside taskChooseOrganization. No issues from a localization-structure perspective.

packages/localizations/src/ar-SA.ts (1)

861-868: Arabic taskResetPassword block matches the shared task schema

taskResetPassword uses the same keys and nesting as other task sections and is correctly wired at the top level; leaving values undefined is consistent with other untranslated entries in this community file.

packages/localizations/src/nl-NL.ts (1)

864-871: Dutch taskResetPassword localization block is correctly shaped

The taskResetPassword entry has the expected keys and nesting and is placed alongside other task-level sections; structurally ready for future translations.

packages/localizations/src/en-GB.ts (1)

866-873: en-GB taskResetPassword entry aligns with task localization contract

The taskResetPassword object is correctly added with formButtonPrimary, nested signOut actions, and title, matching the established structure for session tasks.

packages/localizations/src/zh-CN.ts (1)

851-858: Chinese taskResetPassword block is correctly added and positioned

The new taskResetPassword section uses the correct key names and nesting and is properly inserted among task-level localizations, ready for translation content.

packages/localizations/src/en-US.ts (1)

863-870: LGTM! Well-structured localization entry for the reset password task.

The new taskResetPassword entry follows established patterns and includes appropriate keys for the task flow:

  • Clear title and button text
  • Sign-out action for account switching scenarios (consistent with taskChooseOrganization)
  • Proper capitalization conventions

As noted in your earlier comment, remember to propagate these keys to the other locale files before merging.

packages/localizations/src/id-ID.ts (1)

870-877: Need to verify how the application handles undefined translations and whether this is an intentional phased rollout strategy.

Perfect! The search results confirm this is the Clerk authentication library. Based on the verification, I now have complete clarity:

Clerk officially only maintains the en-US locale, and all other language translations provided within this package are community contributions. The script output shows that taskResetPassword is a newly introduced feature structure across ALL 48 locale files in this PR, with only en-US containing actual translations while all other locales have undefined placeholders.

As part of redesigns of Clerk's components, new localization keys are added, and if translated values are not supplied for these keys in custom localization, they will fall back to the default English values. This is the intended behavior for new features during gradual rollout.

No action needed—Indonesian localization follows expected pattern for new features.

The taskResetPassword block at lines 870–877 with all undefined values is the intentional structure for this new reset-password task feature being added across all locales. The application will automatically fall back to English translations from en-US for undefined values, providing proper UI text for Indonesian users. This is standard Clerk practice: introduce the feature structure across all locales with en-US providing the initial translations, then allow community contributions to fill in other languages over time.

packages/localizations/src/es-UY.ts (1)

871-878: LGTM! Structure is correct and consistent across all locales.

The new taskResetPassword localization key follows the expected structure with formButtonPrimary, signOut (containing actionLink and actionText), and title. Verification confirms this structure is identical across all 52 locale files in the repository. The undefined values are consistent with this community-contributed locale file, which has many incomplete translations throughout—matching the pattern in other community locales like fr-FR, de-DE, it-IT, and pt-BR, while en-US serves as the reference with complete translations.

@octoper octoper changed the title feat(clerk-js): Introduce reset password after auth task feat(clerk-js): Introduce reset password session task Nov 24, 2025
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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ad34a99 and 09227d6.

📒 Files selected for processing (4)
  • packages/clerk-js/bundlewatch.config.json (1 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (1 hunks)
  • packages/shared/src/types/appearance.ts (1 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/clerk-js/bundlewatch.config.json
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/shared/src/types/clerk.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/shared/src/types/appearance.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/shared/src/types/appearance.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/shared/src/types/appearance.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/shared/src/types/appearance.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/shared/src/types/appearance.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/shared/src/types/appearance.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/shared/src/types/appearance.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

task &&
clerk.session?.tasks &&
clerk.session.tasks.length > 0 &&
!clerk.session.tasks.find(t => matches(INTERNAL_SESSION_TASK_ROUTE_BY_KEY[t.key]))
Copy link
Member

Choose a reason for hiding this comment

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

INTERNAL_SESSION_TASK_ROUTE_BY_KEY[t.key]) returns the UI route name for the task, not the task key itself that matches FAPI, so if I'd rename the value of reset-password within that map, this effect would break.

Is the intent here to navigate from /tasks to /tasks/reset-password or /tasks/choose-organization to /tasks/reset-password?

Copy link
Member Author

Choose a reason for hiding this comment

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

the intent here is to go from /tasks/reset-password to /tasks/choose-organization

Comment on lines +33 to +39
const handleSignOut = () => {
if (otherSessions.length === 0) {
return signOut(navigateAfterSignOut);
}

return signOut(navigateAfterMultiSessionSingleSignOutUrl, { sessionId: session?.id });
};
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker for this PR, we can do it in a separate one. I have a proposal to move this sign-out with multi-session handling within the SignOutContext as we're duplicating between two task components now.

We'd have to double-check on how it's being handled within the UserButton popover and potentially reuse it there.

Comment on lines +75 to +77
if (!user) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

We could also add an assertion for clerk.isLoaded before declaring the functions / variable within this component, and then TypeScript would guard against not loaded resources, such as user.

The components only get rendered when Clerk is loaded anyway, so adding a comment to clarify that should suffice.

…update Portuguese localization for reset password
@octoper
Copy link
Member Author

octoper commented Nov 25, 2025

!snapshot

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.2.5-snapshot.v20251125145744
@clerk/astro 2.16.3-snapshot.v20251125145744
@clerk/backend 2.24.0-snapshot.v20251125145744
@clerk/chrome-extension 2.8.5-snapshot.v20251125145744
@clerk/clerk-js 5.110.0-snapshot.v20251125145744
@clerk/elements 0.23.86-snapshot.v20251125145744
@clerk/clerk-expo 2.19.5-snapshot.v20251125145744
@clerk/expo-passkeys 0.4.22-snapshot.v20251125145744
@clerk/express 1.7.53-snapshot.v20251125145744
@clerk/fastify 2.6.5-snapshot.v20251125145744
@clerk/localizations 3.29.0-snapshot.v20251125145744
@clerk/nextjs 6.35.5-snapshot.v20251125145744
@clerk/nuxt 1.13.3-snapshot.v20251125145744
@clerk/clerk-react 5.57.0-snapshot.v20251125145744
@clerk/react-router 2.2.5-snapshot.v20251125145744
@clerk/remix 4.13.20-snapshot.v20251125145744
@clerk/shared 3.36.0-snapshot.v20251125145744
@clerk/tanstack-react-start 0.27.5-snapshot.v20251125145744
@clerk/testing 1.13.19-snapshot.v20251125145744
@clerk/themes 2.4.40-snapshot.v20251125145744
@clerk/types 4.101.3-snapshot.v20251125145744
@clerk/vue 1.17.0-snapshot.v20251125145744

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

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/elements

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --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.

4 participants