Skip to content

feat(js,ui,localizations): limit password confirmation attempts per session - #9913

Merged
tmilewski merged 18 commits into
mainfrom
tom/CORE-3779-pw-change-rate-limit-sdk
Nov 24, 2026
Merged

tmilewski merged 18 commits into
mainfrom
tom/CORE-3779-pw-change-rate-limit-sdk

Conversation

@tmilewski

@tmilewski tmilewski commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Changes in this repo

This PR reads meta.remaining_attempts into ClerkAPIError.meta.remainingAttempts and shows the countdown in the prebuilt components through three new localization keys:

  • unstable__errors.password_confirmation_attempt_remaining
  • unstable__errors.password_confirmation_attempts_remaining (with {{remainingAttempts}})
  • unstable__errors.password_confirmation_session_ended.

The API always enforces this limit, so every instance gets this behavior.

CORE-3779

@changeset-bot

changeset-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40bd06d

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

This PR includes changesets to release 24 packages
Name Type
@clerk/clerk-js Minor
@clerk/localizations Minor
@clerk/shared Minor
@clerk/ui Minor
@clerk/chrome-extension Patch
@clerk/electron Patch
@clerk/expo Patch
@clerk/mosaic Patch
@clerk/react Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/swingset Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch
@clerk/mosaic-docs 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

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 24, 2026 9:24pm UTC
mosaic-docs Ready Ready Preview Nov 24, 2026 9:24pm UTC
swingset Ready Ready Preview Nov 24, 2026 9:24pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

API errors now expose remaining password-confirmation attempts as metadata and serialize the value using the API field name. When an error reports zero attempts, Clerk ends the session. UI forms select localized messages for remaining attempts and ended sessions. Localization entries were added across supported locales.

Estimated code review effort: 3 (Moderate) — 25 minutes

Suggested reviewers: zourzouvillys, dstaley

Merge Risk: Moderate · previous review 8101f

Confirm the backend response contract and address delayed failures signing out a newly selected session before merging. Without the attempt count, both password forms retain generic errors instead of showing the countdown or ended-session feedback.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 46 files. (14 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)

Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: limiting password confirmation attempts per session across JavaScript, UI, and localization packages.
Description check ✅ Passed The description directly explains the API metadata mapping, countdown localization keys, prebuilt component behavior, and session-wide enforcement.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 46 files. (14 skipped: 1 unsupported, 7 too large, 6 over the file limit.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9913

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9913

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9913

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9913

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@9913

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9913

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@9913

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9913

@clerk/upgrade

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

@clerk/vue

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

commit: 40bd06d

@tmilewski tmilewski changed the title Limit password confirmation attempts per session feat(js,ui,localizations): limit password confirmation attempts per session Sep 23, 2026
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-24T21:26:35.576Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 2
🟢 Additions 2

🤖 This report was reviewed by claude-sonnet-4-6.


@clerk/shared

Current version: 4.48.3
Recommended bump: MINOR → 4.49.0

Subpath ./internal/clerk-js/localStorage

🟢 Additions (1)

Added: ./internal/clerk-js/localStorage

New subpath export ./internal/clerk-js/localStorage (6 exported members)

Subpath ./internal/clerk-js/passwordConfirmation

🟢 Additions (1)

Added: ./internal/clerk-js/passwordConfirmation

New subpath export ./internal/clerk-js/passwordConfirmation (4 exported members)

Subpath ./types

🟡 Non-breaking Changes (2)

Modified: ClerkAPIError.meta
// ... 26 unchanged lines elided ...
      linkUrl?: string;
      linkText?: string;
      data?: Record<string, string | number | boolean>;
-     providerError?: string;
+     providerError?: string; /** Remaining password confirmation attempts in the current session; zero means the session has ended. */
+     remainingAttempts?: number;
    };

Static analyzer: Breaking change in property ClerkAPIError.meta: Type changed: {paramName?:string;sessionId?:string;emailAddresses?:string[];identifiers?:string[];zxcvbn?:{suggestions:{code:string;m… → {paramName?:string;sessionId?:string;emailAddresses?:string[];identifiers?:string[];zxcvbn?:{suggestions:{code:string;m…

🤖 AI review (reclassified as non-breaking) (95%): The only change is the addition of a new optional property remainingAttempts? to the meta object. Per rule 9, adding a new optional property is non-breaking for both input and output types: existing consumers neither pass it nor rely on reading it.

Modified: ClerkAPIErrorJSON.meta
// ... 26 unchanged lines elided ...
      link_text?: string;
      data?: Record<string, string | number | boolean>;
      provider_error?: string;
+     remaining_attempts?: number;
    };

Static analyzer: Breaking change in property ClerkAPIErrorJSON.meta: Type changed: {param_name?:string;session_id?:string;email_addresses?:string[];identifiers?:string[];zxcvbn?:{suggestions:{code:strin… → {param_name?:string;session_id?:string;email_addresses?:string[];identifiers?:string[];zxcvbn?:{suggestions:{code:strin…

🤖 AI review (reclassified as non-breaking) (95%): The only change is the addition of a new optional property remaining_attempts? to the meta object. Per rule 9, adding a new optional property is non-breaking for both input and output types: existing consumers neither pass it nor rely on reading it.


Report generated by Break Check

Last ran on 40bd06d.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@alexcarpenter alexcarpenter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Findings below were checked at 419d6338 with local probe tests (jsdom, mocked FAPI responses), not against the real API or in a real browser.

@blacksmith-sh

blacksmith-sh Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Matches Change password shows attempts left, then ends the session

Wrong current password showed 'You have 2 attempts remaining', then '1 attempt remaining'; at 0 the user was signed out and sign-in explained the session ended. Base showed the generic 'Password is incorrect' each time and sign-in gave no reason.

Merge-base

First wrong password

This PR 40bd06d0

First wrong password

Merge-base

Sign-in after limit

This PR 40bd06d0

One attempt left

Sign-in after limit

Also checked · 5 match

Matches Reverification password shows the countdown and ends the session
Matches Session-ended notice survives a reload, shows once
Matches Other open tabs are signed out too
Matches Errors without remaining_attempts keep the old message
Matches redirectToSignIn carries the notice to sign-in via URL

Proof on 40bd06d0 · mocked: Frontend API (remaining_attempts ships in companion clerk_go#22414; a sandbox MSW scenario ret...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@tmilewski
tmilewski merged commit 63864a8 into main Nov 24, 2026
61 checks passed
@tmilewski
tmilewski deleted the tom/CORE-3779-pw-change-rate-limit-sdk branch November 24, 2026 21:33

This branch was successfully deployed

2 active deployments
Preview – swingset — 40bd06d0 Deployed Nov 24, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 40bd06d0 Deployed Nov 24, 2026 by vercel[bot]
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.

2 participants