Skip to content

fix(clerk-js): use custom signInUrl for factor-one and factor-two URLs in OAuth callbacks - #10171

Draft
NicolasLopes7 wants to merge 1 commit into
mainfrom
cursor/fix-factor-one-custom-signin-url-d05c
Draft

NicolasLopes7 wants to merge 1 commit into
mainfrom
cursor/fix-factor-one-custom-signin-url-d05c

Conversation

@NicolasLopes7

Copy link
Copy Markdown
Contributor

Description

This PR addresses a CodeRabbit review comment from #9947 that was not addressed before merge. The issue was flagged as "Major" priority.

Problem: When a custom signInUrl is provided via handleRedirectCallback (e.g., for embedding sign-in on a custom page or domain), the navigateToFactorOne and navigateToFactorTwo functions were building URLs using only the dashboard-configured displayConfig.signInUrl, ignoring the custom URL provided in the params.

Impact: This means users directed to start OAuth sign-in at a custom URL would be redirected to a different URL (the dashboard default) when they need to select between multiple enterprise SSO connections or complete two-factor authentication. This breaks the user experience for custom integrations.

Solution: Update both navigateToFactorOne and navigateToFactorTwo to use params.signInUrl || displayConfig.signInUrl as the base URL, matching the pattern already used by navigateToSignIn. This ensures consistency across all sign-in navigation flows.

Tests: Added tests covering:

  • Enterprise connection chooser (factor-one) with custom sign-in URL
  • Two-factor authentication (factor-two) with custom sign-in URL

References:

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:
Open in Web Open in Cursor 

@vercel

vercel Bot commented Oct 9, 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 Oct 9, 2026 2:45pm UTC
swingset Ready Ready Preview Oct 9, 2026 2:45pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7b60e6

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

This PR includes changesets to release 4 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/electron Patch
@clerk/expo 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

@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: d7b60e6

This branch was successfully deployed

2 active deployments
Preview – swingset — d7b60e67 Deployed Oct 9, 2026 by vercel[bot]
Preview – clerk-js-sandbox — d7b60e67 Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants