Skip to content

feat(ui): support Electron native OAuth redirects#8750

Draft
wobsoriano wants to merge 20 commits into
mainfrom
rob/poc-native-handler-callback
Draft

feat(ui): support Electron native OAuth redirects#8750
wobsoriano wants to merge 20 commits into
mainfrom
rob/poc-native-handler-callback

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jun 4, 2026

Copy link
Copy Markdown
Member

Description

Adds experimental support for native OAuth redirects in Clerk JS/UI so Electron can use Clerk prebuilt components without forking SignIn, SignUp, or UserProfile connected account flows.

The implementation keeps the existing browser APIs as the public entry point. SignIn and SignUp components still call authenticateWithRedirect(), and the SignIn/SignUp resources continue through the existing authenticateWithRedirectOrPopup path. When a native OAuth handler is registered on the Clerk instance, that path swaps only the transport layer:

  • uses __internal_nativeOAuthHandler.getRedirectUrl() as the FAPI redirect URL, for example myapp://sso-callback
  • calls __internal_nativeOAuthHandler.open(url) instead of navigating the current browser context
  • reloads the active SignIn/SignUp resource from the returned callback URL
  • completes the normal Clerk redirect callback handling through __internal_handleNativeOAuthCallback

This PR is intentionally scoped to the Clerk component flows that need OAuth/SSO transport changes for Electron:

  • Social OAuth buttons in SignIn
  • Enterprise SSO in SignIn
  • Social OAuth buttons in SignUp
  • Connected account flows in UserProfile, including enterprise account connections

Default web behavior is unchanged. If __internal_nativeOAuthHandler is not registered, the components continue using the existing browser redirect or popup flow.

The planned @clerk/electron SDK will provide the Electron-specific runtime pieces and register this internal handler from its renderer provider, expected to be imported from @clerk/electron/react. That SDK layer is responsible for main/preload setup, opening the system browser, waiting for the custom-scheme callback, and secure token persistence. The JS/UI packages only define and consume the internal native OAuth transport contract.

This also adds tests for native OAuth success and cancellation/error handling so provider cancellation can stop the loading state, surface the verification error, and reset stale SignIn/SignUp attempts.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring / dependency upgrade / documentation
  • Other

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8a1744d

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 Minor
@clerk/ui Minor
@clerk/clerk-js Minor
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension 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

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 9, 2026 6:18am

Request Review

@github-actions github-actions Bot added the ui label Jun 4, 2026
@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@pkg-pr-new

pkg-pr-new Bot commented Jun 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8a1744d

@github-actions

This comment has been minimized.

@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@github-actions

This comment has been minimized.

@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@github-actions

This comment has been minimized.

@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@github-actions

This comment has been minimized.

@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@github-actions

This comment has been minimized.

@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: f897b428-7448-471c-8fa3-a7a9a82888c2

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@wobsoriano wobsoriano changed the title chore: testing native ignore feat(ui): support Electron native OAuth redirects Jun 8, 2026
@wobsoriano

Copy link
Copy Markdown
Member Author

!snapshot

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 3.3.4-snapshot.v20260608163957
@clerk/backend 3.5.1-snapshot.v20260608163957
@clerk/chrome-extension 3.1.33-snapshot.v20260608163957
@clerk/clerk-js 6.15.0-snapshot.v20260608163957
@clerk/expo 3.3.2-snapshot.v20260608163957
@clerk/expo-passkeys 1.1.2-snapshot.v20260608163957
@clerk/express 2.1.24-snapshot.v20260608163957
@clerk/fastify 3.1.34-snapshot.v20260608163957
@clerk/hono 0.1.34-snapshot.v20260608163957
@clerk/localizations 4.7.2-snapshot.v20260608163957
@clerk/msw 0.0.32-snapshot.v20260608163957
@clerk/nextjs 7.4.4-snapshot.v20260608163957
@clerk/nuxt 2.5.4-snapshot.v20260608163957
@clerk/react 6.7.4-snapshot.v20260608163957
@clerk/react-router 3.3.4-snapshot.v20260608163957
@clerk/shared 4.16.0-snapshot.v20260608163957
@clerk/tanstack-react-start 1.3.4-snapshot.v20260608163957
@clerk/testing 2.0.36-snapshot.v20260608163957
@clerk/ui 1.16.0-snapshot.v20260608163957
@clerk/upgrade 2.0.4-snapshot.v20260608163957
@clerk/vue 2.3.4-snapshot.v20260608163957

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@3.3.4-snapshot.v20260608163957 --save-exact

@clerk/backend

npm i @clerk/backend@3.5.1-snapshot.v20260608163957 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.1.33-snapshot.v20260608163957 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.15.0-snapshot.v20260608163957 --save-exact

@clerk/expo

npm i @clerk/expo@3.3.2-snapshot.v20260608163957 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.1.2-snapshot.v20260608163957 --save-exact

@clerk/express

npm i @clerk/express@2.1.24-snapshot.v20260608163957 --save-exact

@clerk/fastify

npm i @clerk/fastify@3.1.34-snapshot.v20260608163957 --save-exact

@clerk/hono

npm i @clerk/hono@0.1.34-snapshot.v20260608163957 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.7.2-snapshot.v20260608163957 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.32-snapshot.v20260608163957 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.4.4-snapshot.v20260608163957 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.5.4-snapshot.v20260608163957 --save-exact

@clerk/react

npm i @clerk/react@6.7.4-snapshot.v20260608163957 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.3.4-snapshot.v20260608163957 --save-exact

@clerk/shared

npm i @clerk/shared@4.16.0-snapshot.v20260608163957 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.3.4-snapshot.v20260608163957 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.36-snapshot.v20260608163957 --save-exact

@clerk/ui

npm i @clerk/ui@1.16.0-snapshot.v20260608163957 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.4-snapshot.v20260608163957 --save-exact

@clerk/vue

npm i @clerk/vue@2.3.4-snapshot.v20260608163957 --save-exact

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.

1 participant