Skip to content

fix(expo): present inline AuthView as modal to fix OAuth from forgot-…#8260

Open
chriscanin wants to merge 4 commits intomainfrom
chris/fix-inline-authview-sso
Open

fix(expo): present inline AuthView as modal to fix OAuth from forgot-…#8260
chriscanin wants to merge 4 commits intomainfrom
chris/fix-inline-authview-sso

Conversation

@chriscanin
Copy link
Copy Markdown
Member

@chriscanin chriscanin commented Apr 7, 2026

The inline AuthView embedded as a child UIHostingController in React Native's view hierarchy disrupts ASWebAuthenticationSession callbacks during OAuth flows. SSO from the forgot-password screen silently fails because the OAuth callback can't properly update Clerk.shared.client in the embedded context.

Switched ClerkAuthNativeView to present its UIHostingController via UIViewController.present() instead of embedding it as a child view. The visual appearance is unchanged (fullscreen, no animation), but this fixes ASWebAuthenticationSession OAuth callbacks which silently fail when the hosting controller is embedded in React Native's view hierarchy.

Description

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:

…password

The inline AuthView embedded as a child UIHostingController in React Native's
view hierarchy disrupts ASWebAuthenticationSession callbacks during OAuth flows.
SSO from the forgot-password screen would silently fail because the OAuth
callback couldn't properly update Clerk.shared.client in the embedded context.

This changes ClerkAuthNativeView to present the AuthView as a full-screen modal
(matching the working presentAuth() behavior) instead of embedding it inline.
Also adds retry logic for modal presentation after sign-out to handle cases
where a previous modal (e.g., UserProfileView) is still dismissing.
@chriscanin chriscanin self-assigned this Apr 7, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 69f484d

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

This PR includes changesets to release 1 package
Name Type
@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

@chriscanin chriscanin added the expo label Apr 7, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 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 7, 2026 8:10pm

Request Review

Replace the unconditional 0.3s asyncAfter delay with presentWhenReady(),
which presents the auth modal synchronously when possible. The fixed delay
caused a visible white flash on initial mount because ClerkAuthNativeView
is an empty UIView while waiting to present.

When a previous modal (e.g., UserProfileView sign-out) is still dismissing,
use UIViewController.transitionCoordinator to wait for the animation to
complete instead of polling. Falls back to a one-frame DispatchQueue.main.async
retry only when no coordinator is available yet.
@chriscanin chriscanin marked this pull request as ready for review April 7, 2026 19:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 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: 04b1f8d7-7e19-4866-9f20-494e738d1b0a

📥 Commits

Reviewing files that changed from the base of the PR and between d950405 and 69f484d.

📒 Files selected for processing (1)
  • .changeset/fix-inline-authview-sso-oauth.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/fix-inline-authview-sso-oauth.md

📝 Walkthrough

Walkthrough

The iOS auth UI presentation was changed from embedding a UIHostingController as a child view to presenting the auth controller modally. ClerkAuthNativeView no longer stores a hostingController; it creates an auth view controller via a completion-based factory, presents/dismisses it with presentWhenReady/dismissAuthModal, and sends events through a consolidated sendAuthEvent that deduplicates and suppresses cancellation events. removeFromSuperview() now dismisses the modal. ClerkAuthWrapperViewController now reports a sign-in result with sessionId when a new session exists on dismissal (otherwise reports cancelled). A changeset for a patch release was added.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 clearly identifies the main change: switching from embedded to modal presentation of the inline AuthView to fix OAuth flows from the forgot-password screen.
Description check ✅ Passed The description is directly related to the changeset, explaining the technical problem (ASWebAuthenticationSession callbacks disrupted by embedded UIHostingController) and the solution (use UIViewController.present() instead).

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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 7, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 69f484d

@chriscanin
Copy link
Copy Markdown
Member Author

!snapshot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

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

Package Version
@clerk/agent-toolkit 0.3.12-snapshot.v20260407211301
@clerk/astro 3.0.12-snapshot.v20260407211301
@clerk/backend 3.2.8-snapshot.v20260407211301
@clerk/chrome-extension 3.1.9-snapshot.v20260407211301
@clerk/clerk-js 6.5.1-snapshot.v20260407211301
@clerk/dev-cli 0.1.1-snapshot.v20260407211301
@clerk/expo 3.1.9-snapshot.v20260407211301
@clerk/expo-passkeys 1.0.10-snapshot.v20260407211301
@clerk/express 2.1.0-snapshot.v20260407211301
@clerk/fastify 3.1.10-snapshot.v20260407211301
@clerk/hono 0.1.10-snapshot.v20260407211301
@clerk/localizations 4.3.3-snapshot.v20260407211301
@clerk/msw 0.0.10-snapshot.v20260407211301
@clerk/nextjs 7.0.12-snapshot.v20260407211301
@clerk/nuxt 2.1.2-snapshot.v20260407211301
@clerk/react 6.2.1-snapshot.v20260407211301
@clerk/react-router 3.0.12-snapshot.v20260407211301
@clerk/shared 4.5.1-snapshot.v20260407211301
@clerk/tanstack-react-start 1.0.12-snapshot.v20260407211301
@clerk/testing 2.0.12-snapshot.v20260407211301
@clerk/ui 1.4.1-snapshot.v20260407211301
@clerk/upgrade 2.0.3-snapshot.v20260407211301
@clerk/vue 2.0.11-snapshot.v20260407211301

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

npm i @clerk/agent-toolkit@0.3.12-snapshot.v20260407211301 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.12-snapshot.v20260407211301 --save-exact

@clerk/backend

npm i @clerk/backend@3.2.8-snapshot.v20260407211301 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.1.9-snapshot.v20260407211301 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.5.1-snapshot.v20260407211301 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@0.1.1-snapshot.v20260407211301 --save-exact

@clerk/expo

npm i @clerk/expo@3.1.9-snapshot.v20260407211301 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.10-snapshot.v20260407211301 --save-exact

@clerk/express

npm i @clerk/express@2.1.0-snapshot.v20260407211301 --save-exact

@clerk/fastify

npm i @clerk/fastify@3.1.10-snapshot.v20260407211301 --save-exact

@clerk/hono

npm i @clerk/hono@0.1.10-snapshot.v20260407211301 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.3.3-snapshot.v20260407211301 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.10-snapshot.v20260407211301 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.12-snapshot.v20260407211301 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.1.2-snapshot.v20260407211301 --save-exact

@clerk/react

npm i @clerk/react@6.2.1-snapshot.v20260407211301 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.12-snapshot.v20260407211301 --save-exact

@clerk/shared

npm i @clerk/shared@4.5.1-snapshot.v20260407211301 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.12-snapshot.v20260407211301 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.12-snapshot.v20260407211301 --save-exact

@clerk/ui

npm i @clerk/ui@1.4.1-snapshot.v20260407211301 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.3-snapshot.v20260407211301 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.11-snapshot.v20260407211301 --save-exact

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