Skip to content

chore(ui,shared): Remove unused OAuthConsent props#8352

Open
wobsoriano wants to merge 7 commits intomainfrom
rob/oauth-consent-cleanup
Open

chore(ui,shared): Remove unused OAuthConsent props#8352
wobsoriano wants to merge 7 commits intomainfrom
rob/oauth-consent-cleanup

Conversation

@wobsoriano
Copy link
Copy Markdown
Member

@wobsoriano wobsoriano commented Apr 18, 2026

Description

Now that we've implemented OAuthConsent component use in AP (https://github.com/clerk/accounts/pull/1418), we can safely remove the legacy callback path that was built to support the old AP integration.

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:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 18, 2026

🦋 Changeset detected

Latest commit: 89fb61e

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

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

vercel bot commented Apr 18, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Apr 20, 2026 6:56pm

Request Review

@github-actions github-actions bot added the ui label Apr 18, 2026
Remove the accounts portal callback path (hasContextCallbacks) and all
deprecated props (scopes, oauthApplicationName, onAllow/onDeny, redirectUrl
as a pre-fetched value) now that the accounts portal renders OAuthConsent
via URL params without pre-fetched data or JS callbacks.

Add redirectUrl as an overridable prop alongside oauthClientId and scope,
so callers embedding the component without URL params can supply it directly.
@wobsoriano wobsoriano marked this pull request as ready for review April 20, 2026 18:23
@wobsoriano wobsoriano changed the title chore(ui,shared,types): Remove unused OAuthConsent props chore(ui,shared): Remove unused OAuthConsent props Apr 20, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a3dc2353-2c00-4989-8c1f-ce58725dbb86

📥 Commits

Reviewing files that changed from the base of the PR and between f7c2d3c and 89fb61e.

📒 Files selected for processing (1)
  • .changeset/large-items-jam.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/large-items-jam.md

📝 Walkthrough

Walkthrough

This PR removes deprecated OAuth consent properties and corresponding context payload fields, updates JSDoc for redirectUrl, and refactors the OAuthConsent component to always use useOAuthConsent (removing the context-callback gating and form onSubmit). Hidden forwarded inputs are rendered unconditionally (except organization_id controlled by org-selection), error/loading UI applies unconditionally, and scope/application data is sourced from the hook response. Tests were updated to assert redirectUrl prop precedence. A small utility refactor adds explicit block-scoped if statements in hostname display logic.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Detailed analysis

Files modified

  • packages/shared/src/types/clerk.ts

    • Removed deprecated optional fields from __internal_OAuthConsentProps: oAuthApplicationName, oAuthApplicationLogoUrl, oAuthApplicationUrl, scopes, onAllow, onDeny.
    • Updated JSDoc for redirectUrl to state it overrides redirect URI and defaults to the redirect_uri query parameter.
  • packages/ui/src/types.ts

    • Removed the same deprecated fields from OAuthConsentCtx.
    • Updated doc comments for oauthClientId, scope, and redirectUrl to indicate defaulting from URL query params.
  • packages/ui/src/components/OAuthConsent/OAuthConsent.tsx

    • Removed conditional path that used context callbacks (hasContextCallbacks) and the handleSubmit branch.
    • useOAuthConsent is always invoked; consent scopes and OAuth application fields now always come from hook data.
    • Removed form onSubmit; hidden forwarded inputs are rendered unconditionally (except organization_id still tied to org-selection).
    • Error/loading UI applies unconditionally; scope rendering uses the hook’s shape directly.
  • packages/ui/src/contexts/ClerkUIComponentsContext.tsx

    • Provider value for OAuthConsentContext no longer includes scopes, oauthApplicationName, oauthApplicationLogoUrl, oauthApplicationUrl, onAllow, or onDeny; remaining fields include componentName, oauthClientId, scope, redirectUrl, appearance, and enableOrgSelection.
  • packages/ui/src/components/OAuthConsent/tests/OAuthConsent.test.tsx

    • Removed test asserting context-callback precedence and related spies/assertions.
    • Added/updated test to assert redirectUrl prop takes precedence over URL redirect_uri parameter.
  • packages/ui/src/components/OAuthConsent/utils.ts

    • Minor refactor: getRedirectDisplay changed to use explicit block-scoped if statements for early returns and IPv4/IPv6 checks; logic unchanged.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing unused OAuthConsent properties across ui and shared packages after their legacy callback path is no longer needed.
Description check ✅ Passed The description is directly related to the changeset, explaining the removal of legacy callback paths now that OAuthConsent is implemented in Accounts Portal via URL params.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 20, 2026

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 89fb61e

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.

1 participant