Skip to content

Conversation

@LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Oct 30, 2025

Description

We caught a bug on IdP-Initiated flows, with legal consent enabled, where FAPI would redirect to /sign-up but the form still gets shown with password even tho it's not required for enterprise SSO.

For those cases, where sign-up with ticket has missing_requirements status, then it should navigate to /sign-up/continue route to show the missing fields.

CleanShot.2025-11-03.at.20.14.12.mp4

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

  • Bug Fixes
    • Fixed an issue where sign-up flows with missing requirements (such as legal consent acceptance) now properly guide users through the continuation step to complete their registration.

@LauraBeatris LauraBeatris self-assigned this Oct 30, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2025

🦋 Changeset detected

Latest commit: f3516ce

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

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

@vercel
Copy link

vercel bot commented Oct 30, 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 3, 2025 11:19pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

Adds a continuePath: './continue' parameter to the sign-up flow in clerk-js, enabling users with missing requirements (such as pending legal consent) to navigate to a continuation page following IdP-initiated sign-ups.

Changes

Cohort / File(s) Summary
Sign-up flow routing
packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
Added continuePath: './continue' parameter to the post-signup flow handler, routing users with missing_requirements status to the continuation page
Changeset documentation
.changeset/silly-zoos-decide.md
Patch version bump entry documenting fix for IdP-initiated flows with missing requirements, routing to /sign-up/continue

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single parameter addition to an existing function call
  • Minimal code change with straightforward intent
  • Changeset is purely documentation

Poem

A rabbit hops down the sign-up trail,
Through consent and ID, without fail,
When requirements linger and block the way,
To /sign-up/continue they gently sway! 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: navigating to '/sign-up/continue' with ticket strategy when handling sign-up flows with missing requirements.
✨ 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 laura/fix-sign-up-with-legal-missing-only

📜 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 41d8c89 and f3516ce.

📒 Files selected for processing (2)
  • .changeset/silly-zoos-decide.md (1 hunks)
  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should always be camelCase
Use element descriptors in UI components to enable consistent theming and styling via appearance.elements
Element descriptors should generate unique, stable CSS classes for theming
Element descriptors should handle state classes (e.g., cl-loading, cl-active, cl-error, cl-open) automatically based on component state
Do not render hard-coded values; all user-facing strings must be localized using provided localization methods
Use the useLocalizations hook and localizationKeys utility for all text and error messages
Use the styled system (sx prop, theme tokens, responsive values) for custom component styling
Use useCardState for card-level state, useFormState for form-level state, and useLoadingStatus for loading states
Always use handleError utility for API errors and use translateError for localized error messages
Use useFormControl for form field state, implement proper validation, and handle loading and error states in forms
Use localization keys for all form labels and placeholders
Use element descriptors for consistent styling and follow the theme token system
Use the Card and FormContainer patterns for consistent UI structure

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,jsx,ts,tsx}

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

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
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
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

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

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
packages/**/*.{ts,tsx,d.ts}

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

Packages should export TypeScript types alongside runtime code

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{ts,tsx}

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

Use proper TypeScript error types

**/*.{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
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
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Use error boundaries in React components
Minimize re-renders in React components

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components: UserProfile, NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,ts,tsx,jsx}

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

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.tsx

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

**/*.tsx: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/silly-zoos-decide.md
⏰ 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). (30)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx (1)

167-167: LGTM! Correctly adds navigation path for missing requirements.

The continuePath: './continue' parameter enables proper navigation to /sign-up/continue when a ticket-based sign-up has missing_requirements status, which aligns with the PR objective to fix IdP-initiated flows with missing legal consent.

.changeset/silly-zoos-decide.md (1)

1-7: LGTM! Changeset correctly documents the bug fix.

The changeset properly documents a patch version bump for the navigation fix to /sign-up/continue for ticket-based sign-ups with missing requirements.


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 30, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: f3516ce

@LauraBeatris
Copy link
Member Author

We've done some testing and the password field is being sent as empty even tho is not being displayed on the sign-up form.

I'll update the changes here soon to address that.

@blacksmith-sh

This comment has been minimized.

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 e42d5f6 and 21e0d93.

📒 Files selected for processing (1)
  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should always be camelCase
Use element descriptors in UI components to enable consistent theming and styling via appearance.elements
Element descriptors should generate unique, stable CSS classes for theming
Element descriptors should handle state classes (e.g., cl-loading, cl-active, cl-error, cl-open) automatically based on component state
Do not render hard-coded values; all user-facing strings must be localized using provided localization methods
Use the useLocalizations hook and localizationKeys utility for all text and error messages
Use the styled system (sx prop, theme tokens, responsive values) for custom component styling
Use useCardState for card-level state, useFormState for form-level state, and useLoadingStatus for loading states
Always use handleError utility for API errors and use translateError for localized error messages
Use useFormControl for form field state, implement proper validation, and handle loading and error states in forms
Use localization keys for all form labels and placeholders
Use element descriptors for consistent styling and follow the theme token system
Use the Card and FormContainer patterns for consistent UI structure

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,jsx,ts,tsx}

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

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
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
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

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

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
packages/**/*.{ts,tsx,d.ts}

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

Packages should export TypeScript types alongside runtime code

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{ts,tsx}

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

Use proper TypeScript error types

**/*.{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
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
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Use error boundaries in React components
Minimize re-renders in React components

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components: UserProfile, NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.{js,ts,tsx,jsx}

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

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
**/*.tsx

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

**/*.tsx: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering

Files:

  • packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx (3)
packages/clerk-js/src/ui/components/SignUp/signUpFormHelpers.ts (1)
  • determineActiveFields (49-57)
packages/clerk-js/src/ui/components/SignUp/SignUpSocialButtons.tsx (1)
  • SignUpSocialButtons (21-93)
packages/clerk-js/src/ui/components/SignUp/SignUpForm.tsx (1)
  • SignUpForm (21-141)
⏰ 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 (5)
packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx (5)

4-4: LGTM!

The useMemo import is correctly added to support the memoization logic introduced later in the component.


133-141: Correctly identifies legal-consent-only state.

The memoization logic properly detects when only the legal_accepted field is missing with no unverified fields, which aligns with the PR objective to fix the IdP-initiated flow bug. The dependencies and null-safety checks are appropriate.


142-150: LGTM!

Passing signUp to determineActiveFields enables more precise field determination based on the sign-up state, which is necessary for the legal-consent-only flow.


446-456: LGTM!

Correctly hides social authentication buttons when only legal consent is required. This prevents showing unnecessary authentication options after the user has already authenticated via enterprise SSO.


462-462: LGTM!

Passing onlyLegalAcceptedMissing to SignUpForm enables the form to conditionally render only the legal consent field and submit button, which aligns with the PR objective.

Comment on lines 263 to 266
// Do not submit password field when patching sign up with legal missing only
if (onlyLegalAcceptedMissing) {
delete fields.password;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Avoid direct mutation of the fields object.

While this achieves the goal of excluding the password field, directly mutating fields with delete violates immutability principles and could cause confusion or subtle bugs if fields is referenced elsewhere.

Apply this diff to filter password during submission instead of mutating:

-    // Do not submit password field when patching sign up with legal missing only
-    if (onlyLegalAcceptedMissing) {
-      delete fields.password;
-    }
-
     type FormStateKey = keyof typeof formState;
     const fieldsToSubmit = Object.entries(fields).reduce((acc, [k, v]) => {
+      // Do not submit password field when patching sign up with legal missing only
+      if (onlyLegalAcceptedMissing && k === 'password') {
+        return acc;
+      }
       acc.push(...(v && formState[k as FormStateKey] ? [formState[k as FormStateKey]] : []));
       return acc;
     }, [] as Array<FormControlState>);
📝 Committable suggestion

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

Suggested change
// Do not submit password field when patching sign up with legal missing only
if (onlyLegalAcceptedMissing) {
delete fields.password;
}
type FormStateKey = keyof typeof formState;
const fieldsToSubmit = Object.entries(fields).reduce((acc, [k, v]) => {
// Do not submit password field when patching sign up with legal missing only
if (onlyLegalAcceptedMissing && k === 'password') {
return acc;
}
acc.push(...(v && formState[k as FormStateKey] ? [formState[k as FormStateKey]] : []));
return acc;
}, [] as Array<FormControlState>);
🤖 Prompt for AI Agents
In packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx around lines 263
to 266, the code currently deletes fields.password directly which mutates the
incoming fields object; instead create a new object for submission that omits
the password when onlyLegalAcceptedMissing is true (e.g., use object spread and
conditional property omission or a shallow copy filtered to exclude the password
key) so the original fields remains immutable and types are preserved; replace
the delete with constructing a newSubmissionFields variable and use that for the
patch/submit call.

@blacksmith-sh
Copy link

blacksmith-sh bot commented Nov 3, 2025

Found 75 test failures on Blacksmith runners:

Test View Logs
[chrome] › integration/tests/
components.test.ts:102:9 › component smoke tests @generic › long-running--next.appRoute
r.withEmailCodes › SignIn supports fallback
View Logs
[chrome] › integration/tests/
components.test.ts:102:9 › component smoke tests @generic › long-running--next.appRoute
r.withEmailCodes › Waitlist supports fallback
View Logs
[chrome] › integration/tests/
components.test.ts:102:9 › component smoke tests @generic › long-running--react.vite.wi
thEmailCodes › SignIn supports fallback
View Logs
[chrome] › integration/tests/
components.test.ts:102:9 › component smoke tests @generic › long-running--react.vite.wi
thEmailCodes › Waitlist supports fallback
View Logs
[chrome] › integration/tests/custom-flows/
sign-in.test.ts:51:7 › Custom Flows Sign In @custom › can sign in with email code
View Logs
[chrome] › integration/tests/custom-flows/
sign-in.test.ts:65:7 › Custom Flows Sign In @custom › renders error with invalid email
code
View Logs
[chrome] › integration/tests/custom-flows/
sign-in.test.ts:78:7 › Custom Flows Sign In @custom › can sign in with phone code
View Logs
[chrome] › integration/tests/custom-flows/
sign-in.test.ts:92:7 › Custom Flows Sign In @custom › can sign in with password
View Logs
[chrome] › integration/tests/custom-flows/
sign-up.test.ts:53:7 › Custom Flows Sign Up @custom › can sign up with email and passwo
rd
View Logs
[chrome] › integration/tests/
custom-pages.test.ts:175:11 › user profile custom pages @generic › long-running--react.
vite.withEmailCodes › User Button with experimental asStandalone and asProvider › items
at the specified order
View Logs
[chrome] › integration/tests/
custom-pages.test.ts:299:11 › user profile custom pages @generic › long-running--react.
vite.withEmailCodes › User Button custom items › onClick custom item action
View Logs
[chrome] › integration/tests/
custom-pages.test.ts:65:13 › user profile custom pages @generic › long-running--react.v
ite.withEmailCodes › Custom pages coming from <UserButton/>
› user profile has all custom pages with icons in the side nav with specified order
View Logs
[chrome] › integration/tests/
custom-pages.test.ts:65:13 › user profile custom pages @generic › long-running--react.v
ite.withEmailCodes › Custom pages coming from <UserProfile/>
› user profile has all custom pages with icons in the side nav with specified order
View Logs
[chrome] › integration/tests/elements/
next-sign-in.test.ts:33:7 › Next.js Sign-In Flow @elements › long-running--elements.nex
t.appRouter › sign in with email and password
View Logs
[chrome] › integration/tests/elements/
next-sign-up.test.ts:13:7 › Next.js Sign-Up Flow @elements › long-running--elements.nex
t.appRouter › sign up with email and password
View Logs
[chrome] › integration/tests/elements/
otp.test.ts:135:9 › OTP @elements › long-running--elements.next.appRouter › Type: segme
nted-otp › should replace selected segment with new input
View Logs
[chrome] › integration/tests/expo-web/
basic.test.ts:35:9 › basic tests for expo web @expo-web › long-running--expo.expo-web ›
can sign in and user button renders
View Logs
[chrome] › integration/tests/expo-web/
custom-flows.test.ts:35:9 › custom flows test suite @expo-web › long-running--expo.expo
-web › sign in using custom flow
View Logs
[chrome] › integration/tests/expo-web/
custom-flows.test.ts:55:9 › custom flows test suite @expo-web › long-running--expo.expo
-web › sign up using custom flow and also delete user
View Logs
[chrome] › integration/tests/express/
basic.test.ts:24:7 › basic tests for @express › long-running--express.vite.withEmailCod
es › authenticates protected routes when user is signed in using getAuth()
View Logs
[chrome] › integration/tests/express/
basic.test.ts:42:7 › basic tests for @express › long-running--express.vite.withEmailCod
es › rejects protected routes when user is not authenticated using getAuth()
View Logs
[chrome] › integration/tests/express/
basic.test.ts:54:7 › basic tests for @express › long-running--express.vite.withEmailCod
es › authenticates protected routes when user is signed in using legacy req.auth approa
ch
View Logs
[chrome] › integration/tests/express/
basic.test.ts:75:7 › basic tests for @express › long-running--express.vite.withEmailCod
es › rejects protected routes when user is not authenticated using legacy req.auth appr
oach
View Logs
[chrome] › integration/tests/next-account-portal/
clerk-v4-ap-core-1.test.ts:30:7 › Next with ClerkJS V4 <->
Account Portal Core 1 @ap-flows › sign in
View Logs
[chrome] › integration/tests/next-account-portal/
clerk-v5-ap-core-1.test.ts:30:7 › Next with ClerkJS V5 <->
Account Portal Core 1 @ap-flows › sign in
View Logs
[chrome] › integration/tests/
next-quickstart.test.ts:23:7 › nextjs @quickstart › long-running--quickstart.next.appRo
uter › Clerk client loads on first visit and Sign In button renders
View Logs
[chrome] › integration/tests/
next-quickstart.test.ts:23:7 › nextjs @quickstart › long-running--quickstart.next.appRo
uter › Clerk client loads on first visit and Sign In button renders
View Logs
[chrome] › integration/tests/
oauth-flows.test.ts:38:7 › oauth flows @nextjs › long-running--next.appRouter.withEmail
Codes › sign up with custom oauth provider
View Logs
[chrome] › integration/tests/
oauth-flows.test.ts:38:7 › oauth flows @nextjs › long-running--next.appRouter.withEmail
Codes › sign up with custom oauth provider
View Logs
[chrome] › integration/tests/
oauth-flows.test.ts:38:7 › oauth flows @nextjs › long-running--next.appRouter.withEmail
Codes › sign up with custom oauth provider
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:110:9 › pricing table @billing › long-running--withBilling.astro.
node › when signed in flow › subscribes to a plan
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:110:9 › pricing table @billing › long-running--withBilling.next.a
ppRouter › when signed in flow › subscribes to a plan
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:110:9 › pricing table @billing › long-running--withBilling.vue.vi
te › when signed in flow › subscribes to a plan
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:221:7 › pricing table @billing › long-running--withBilling.astro.
node › user is prompted to add email before checkout
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:221:7 › pricing table @billing › long-running--withBilling.next.a
ppRouter › user is prompted to add email before checkout
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:250:7 › pricing table @billing › long-running--withBilling.next.a
ppRouter › starts free trial subscription for new user
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:456:9 › pricing table @billing › long-running--withBilling.vue.vi
te › in UserProfile › renders pricing table, subscribes to a plan, revalidates payment
method on complete and then downgrades to free
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:588:9 › pricing table @billing › long-running--withBilling.next.a
ppRouter › in UserProfile › adds payment method via checkout and resets stripe setup in
tent after failed payment
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:80:9 › pricing table @billing › long-running--withBilling.astro.n
ode › when signed in flow › when signed in, clicking get started button opens checkout
drawer and shows free plan as active
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:80:9 › pricing table @billing › long-running--withBilling.next.ap
pRouter › when signed in flow › when signed in, clicking get started button opens check
out drawer and shows free plan as active
View Logs
[chrome] › integration/tests/
pricing-table.test.ts:80:9 › pricing table @billing › long-running--withBilling.vue.vit
e › when signed in flow › when signed in, clicking get started button opens checkout dr
awer and shows free plan as active
View Logs
[chrome] › integration/tests/react-router/
basic.test.ts:35:9 › basic tests for @react-router with middleware › long-running--reac
t-router.node › can sign in and user button renders
View Logs
[chrome] › integration/tests/react-router/
basic.test.ts:53:9 › basic tests for @react-router with middleware › long-running--reac
t-router.node › redirects to sign-in when unauthenticated
View Logs
[chrome] › integration/tests/react-router/
basic.test.ts:61:9 › basic tests for @react-router with middleware › long-running--reac
t-router.node › renders control components contents
View Logs
[chrome] › integration/tests/react-router/
basic.test.ts:74:9 › basic tests for @react-router with middleware › long-running--reac
t-router.node › renders user profile with SSR data
View Logs
[chrome] › integration/tests/react-router/
library-mode.test.ts:40:7 › Library Mode basic tests for @react-router › should log in
successfully
View Logs
[chrome] › integration/tests/react-router/
pre-middleware.test.ts:113:7 › basic tests for @react-router without middleware › can s
ign in and user button renders
View Logs
[chrome] › integration/tests/react-router/
pre-middleware.test.ts:131:7 › basic tests for @react-router without middleware › redir
ects to sign-in when unauthenticated
View Logs
[chrome] › integration/tests/react-router/
pre-middleware.test.ts:139:7 › basic tests for @react-router without middleware › rende
rs control components contents
View Logs
[chrome] › integration/tests/
redirects.test.ts:34:9 › redirect props @nextjs › long-running--next.appRouter.withEmai
lCodes › SignInButton › sign in button respects forceRedirectUrl
View Logs
[chrome] › integration/tests/
redirects.test.ts:34:9 › redirect props @nextjs › long-running--next.appRouter.withEmai
lCodes › SignInButton › sign in button respects forceRedirectUrl
View Logs
[chrome] › integration/tests/
redirects.test.ts:34:9 › redirect props @nextjs › long-running--next.appRouter.withEmai
lCodes › SignInButton › sign in button respects forceRedirectUrl
View Logs
[chrome] › integration/tests/
session-tasks-multi-session.test.ts:33:9 › session tasks multi-session flow @nextjs › l
ong-running--next.appRouter.withSessionTasks › when switching sessions, navigate to tas
k
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:29:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › flows are combined
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:29:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › flows are combined
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:29:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › flows are combined
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:124:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up with first name, last name, email, phone and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:124:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up with first name, last name, email, phone and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:124:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up with first name, last name, email, phone and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:13:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign up with email and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:13:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign up with email and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:13:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign up with email and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:65:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can sign up with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:65:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can sign up with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:65:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can sign up with phone number
View Logs
[chrome] › integration/tests/tanstack-start/
basic.test.ts:43:9 › basic tests for TanStack Start @tanstack-react-start › long-runnin
g--tanstack.react-start › can sign in and user button renders
View Logs
[chrome] › integration/tests/tanstack-start/
basic.test.ts:61:9 › basic tests for TanStack Start @tanstack-react-start › long-runnin
g--tanstack.react-start › clerk handler has ran
View Logs
[chrome] › integration/tests/tanstack-start/
basic.test.ts:77:9 › basic tests for TanStack Start @tanstack-react-start › long-runnin
g--tanstack.react-start › retrieve auth state in server functions
View Logs
[chrome] › integration/tests/tanstack-start/
basic.test.ts:96:9 › basic tests for TanStack Start @tanstack-react-start › long-runnin
g--tanstack.react-start › clerk handler sets headers
View Logs
[chrome] › integration/tests/
unsafeMetadata.test.ts:13:7 › unsafeMetadata @nextjs › long-running--next.appRouter.wit
hEmailCodes › sign up persists unsafeMetadata
View Logs
[chrome] › integration/tests/
unsafeMetadata.test.ts:13:7 › unsafeMetadata @nextjs › long-running--next.appRouter.wit
hEmailCodes › sign up persists unsafeMetadata
View Logs
[setup] › integration/tests/
global.setup.ts:7:6 › start long running apps ─────────────────────
View Logs


Fix in Cursor

@LauraBeatris LauraBeatris force-pushed the laura/fix-sign-up-with-legal-missing-only branch from f48255c to 9140af7 Compare November 3, 2025 23:10
@LauraBeatris LauraBeatris force-pushed the laura/fix-sign-up-with-legal-missing-only branch from 9140af7 to 41d8c89 Compare November 3, 2025 23:11
@LauraBeatris LauraBeatris changed the title fix(clerk-js): Display legal consent only based on missing fields fix(clerk-js): Navigate to /sign-up/continue with ticket strategy Nov 3, 2025
@LauraBeatris LauraBeatris force-pushed the laura/fix-sign-up-with-legal-missing-only branch from 41d8c89 to ff00f17 Compare November 3, 2025 23:14
@LauraBeatris LauraBeatris force-pushed the laura/fix-sign-up-with-legal-missing-only branch 2 times, most recently from 24d2f43 to 406a7e8 Compare November 3, 2025 23:16
@LauraBeatris LauraBeatris force-pushed the laura/fix-sign-up-with-legal-missing-only branch 2 times, most recently from 8ce6d05 to 61d97b1 Compare November 3, 2025 23:17
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.

3 participants