Skip to content

Conversation

@dstaley
Copy link
Member

@dstaley dstaley commented Nov 10, 2025

Description

This PR adds support for passing a Window to signUp.sso via the popup parameter to perform external verification via a modal window.

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

Release Notes

  • New Features
    • [Experimental] Added modal-based sign-up support for SSO flows
    • Enhanced pop-up window handling for improved SSO user experience
    • Added automatic retry mechanism for captcha verification failures
    • Expanded enterprise SSO configuration options

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 6a54d76

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

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Minor
@clerk/shared Minor
@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/clerk-react Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/types Patch
@clerk/vue Patch
@clerk/localizations 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 10, 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 14, 2025 5:02pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR adds experimental support for sign-up via modal in the signals implementation by introducing popup routing logic, updating type definitions to support Window-based popup objects and additional SSO parameters (identifier, oidcPrompt, enterpriseConnectionId, emailAddress), and refactoring the SSO flow to handle modal-based authentication with redirect URL management.

Changes

Cohort / File(s) Summary
Changeset versioning
.changeset/fruity-rivers-say.md
Added changeset for minor version bumps of @clerk/clerk-js and @clerk/shared with description of experimental sign-up via modal support.
SignIn SSO updates
packages/clerk-js/src/core/resources/SignIn.ts
Extended identifier parameter handling in SignInFuture.sso to destructure and forward identifier to the internal _create call.
SignUp SSO modal implementation
packages/clerk-js/src/core/resources/SignUp.ts
Expanded imports for popup utilities; refactored SignUpFuture.sso to extract additional SSO parameters (unsafeMetadata, legalAccepted, oidcPrompt, enterpriseConnectionId, emailAddress, popup); implemented routing logic with conditional popup wrapping via wrapWithPopupRoutes; added captcha error handling with environment reload; integrated _futureAuthenticateWithPopup for popup-based verification flows.
Type definitions for SSO
packages/shared/src/types/signInFuture.ts, packages/shared/src/types/signUpFuture.ts
Updated SignInFutureSSOParams.popup from object to Window type and added optional identifier field; extended SignUpFutureSSOParams with popup (Window), oidcPrompt, enterpriseConnectionId, and emailAddress properties.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant SignUpFuture
    participant PopupRouter
    participant AuthService
    participant ExternalService

    User->>App: Initiate SSO signup with popup
    App->>SignUpFuture: sso({ strategy, popup, redirectUrlComplete, ... })
    
    alt Popup Mode
        SignUpFuture->>PopupRouter: wrapWithPopupRoutes(strategy, redirectUrl)
        PopupRouter-->>SignUpFuture: wrapped routes
        SignUpFuture->>AuthService: POST with routes + strategy
        
        AuthService->>ExternalService: External verification
        ExternalService-->>AuthService: Verify response
        
        alt Verification Unverified
            AuthService-->>SignUpFuture: externalVerificationRedirectURL
            SignUpFuture->>SignUpFuture: _futureAuthenticateWithPopup()
            SignUpFuture->>SignUpFuture: reload resource
        else Verification Complete
            AuthService-->>SignUpFuture: Success
            SignUpFuture->>App: Signal completion
        end
    else Standard Mode
        SignUpFuture->>AuthService: POST strategy + fields
        AuthService->>App: Navigate to externalVerificationRedirectURL
    end

    alt Captcha Error
        AuthService-->>SignUpFuture: Captcha error
        SignUpFuture->>App: Reload environment
        SignUpFuture->>AuthService: Retry authenticateFn
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • SignUp.ts modal routing logic: The conditional popup wrapping, route remapping, and post-response handling require careful verification of the redirect flow logic.
  • Captcha error retry mechanism: Review the environment reload and retry pattern to ensure proper error recovery.
  • Type signature changes: Verify that the Window type change for popup and new optional parameters are correctly propagated across the codebase.
  • Integration with _futureAuthenticateWithPopup: Confirm the new utility function is properly invoked and handles the modal authentication flow as intended.

Possibly related PRs

Suggested reviewers

  • brkalow

Poem

🐰 A modal dance, so sleek and bright,
Pop-ups flutter left and right,
Sign-up flows through windows flow,
Experimental magic—watch us grow!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(clerk-js,shared): Add support for modal sign-up in signals' directly corresponds to the main change: adding popup/modal window support for SSO flows in the sign-up and sign-in implementations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 10, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 6a54d76

@dstaley dstaley merged commit aa184a4 into main Nov 14, 2025
43 checks passed
@dstaley dstaley deleted the ds.feat/signals-sso-modal-signup branch November 14, 2025 17:12
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.

4 participants