Skip to content

fix(expo): Pass through user name on native Apple sign-in#9214

Merged
wobsoriano merged 7 commits into
mainfrom
fix/expo-native-oauth-name-passthrough
Jul 22, 2026
Merged

fix(expo): Pass through user name on native Apple sign-in#9214
wobsoriano merged 7 commits into
mainfrom
fix/expo-native-oauth-name-passthrough

Conversation

@claude

@claude claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Original investigation requested by Mike Pitre via Slack thread. Scope revised after verifying the behavior against FAPI source.

Description

Before: useSignInWithApple called signIn.create() first with only the Apple ID token and never read credential.fullName off the native credential. Apple only provides the user's name in the native credential on first authorization, never inside the identity token, so a brand-new user's name was structurally dropped. Reported by a customer whose App Store submission was rejected over the Sign in with Apple name requirement.

After: useSignInWithApple signs up first, passing firstName/lastName from the Apple credential. If the account already exists, FAPI returns the sign-up with a transferable external account verification and the hook completes authentication via signIn.create({ transfer: true }). On instances with restricted or waitlist sign-up mode, FAPI rejects the sign-up create before checking whether the account exists (sign_up_mode_restricted / sign_up_restricted_waitlist), so the hook catches those and falls back to a direct token sign-in. Existing users keep working and new users stay blocked, preserving current behavior on those instances.

useSignInWithGoogle is intentionally unchanged. Verified against FAPI source: Google names are populated server-side from the One Tap ID token's given_name/family_name claims, so the name bug cannot occur for Google. Additionally, the google_one_tap strategy never returns a transferable status (an existing account throws external_account_exists before any account transfer is created), so a sign-up-first restructure would add a guaranteed failed request for every existing user while fixing nothing. clerk-android's Google flow is sign-in-first for the same reason.

No public API changes.

Checklist

  • pnpm --filter @clerk/expo test runs as expected (108 passed)
  • pnpm turbo build --filter=@clerk/expo runs as expected
  • pnpm turbo lint --filter=@clerk/expo runs as expected

Type of change

  • 🐛 Bug fix

Testing note

Apple returns fullName only on the first authorization of the app for a given Apple ID, afterwards it is always null. To verify the fix as a "new user", deleting the Clerk user from the dashboard is not enough. Also revoke the app's authorization on the device (Settings > Apple Account > Sign in with Apple > select the app > Stop Using Apple ID), then sign in again. Retesting without revoking will still produce a nameless sign-up by design, that case is covered by the "credential without a name" unit test.

useSignInWithApple and useSignInWithGoogle called signIn.create() first
and only fell back to signUp.create({ transfer: true }) for new users,
so the name Apple/Google hand back on the credential was never read and
never recorded. Restructure both hooks to sign-up-first (passing
firstName/lastName from the native credential), falling back to
signIn.create({ transfer: true }) only when the account already exists,
matching clerk-ios's signUpWithIdToken + handleTransferFlow pattern.

Public hook signatures and return types are unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158VB1fS18rJ8AGoqBR3ZrB
@vercel

vercel Bot commented Jul 22, 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 Jul 22, 2026 6:22pm
swingset Ready Ready Preview, Comment Jul 22, 2026 6:22pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 607b5e0

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9214

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9214

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9214

@clerk/expo

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

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9214

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 607b5e0

@mikepitre
mikepitre marked this pull request as ready for review July 22, 2026 15:27
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-22T18:22:54.999Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 607b5e0.

@mikepitre

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c17526809f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/expo/src/hooks/useSignInWithApple.ios.ts Outdated
Comment thread .changeset/fix-expo-native-oauth-name.md Outdated
…omments

Address Codex review feedback on PR #9214: keep the changeset focused
on user-facing behavior only, and condense the multi-line rationale
comments in useSignInWithApple.ios.ts and useSignInWithGoogle.shared.ts
to single terse lines per the repo's comment convention.
@wobsoriano wobsoriano changed the title fix(expo): pass through user name on native Apple/Google sign-in fix(expo): pass through user name on native Apple sign-in Jul 22, 2026
@wobsoriano wobsoriano changed the title fix(expo): pass through user name on native Apple sign-in fix(expo): Pass through user name on native Apple sign-in Jul 22, 2026
@wobsoriano

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 2758054538

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@wobsoriano wobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified via manual tests

@wobsoriano
wobsoriano merged commit 94405d4 into main Jul 22, 2026
58 checks passed
@wobsoriano
wobsoriano deleted the fix/expo-native-oauth-name-passthrough branch July 22, 2026 18:37
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