Repository navigation
fix(expo): throw the verification error when Apple sign-in needs email verification - #10644
Conversation
…l verification On instances with restricted sign-ups, useSignInWithApple falls back to signIn.create with the Apple token. When the server asks for email re-verification, the sign-in comes back as needs_first_factor with the error on firstFactorVerification, and the hook returned no session and no error. It now throws that error as a ClerkAPIResponseError, matching clerk-ios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7905207 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |


Description
On instances that restrict sign-ups,
useSignInWithApplefalls back tosignIn.create({ strategy: 'oauth_token_apple' }). When the server needs the user to verify their email address before the Apple account can be used, that sign-in comes back asneeds_first_factorwith the error onfirstFactorVerification(external_account_email_address_verification_required). The hook returnedcreatedSessionId: nulland no error, so the app had no way to tell the user what happened.The hook now throws that error as a
ClerkAPIResponseError, so apps can catch it withisClerkAPIResponseErrorand readerrors[0].code. This matches clerk-ios, which throws the first-factor verification error fromsignInWithApple. The server returned a 200 for this response, so the thrown error uses status 422. The normal sign-up and transfer path is unchanged.Verified on an iOS simulator with the verify-clerk-expo skill, spec
specs/explored/apple-verification-error.e2e.ts: before runr20261104-100014-16feonmain's hook, after runr20261104-100054-902aon this branch. No test user can reach this state, because the simulator has no Apple ID for Sign in with Apple and the server checks the Apple identity token's signature. So both runs used the same local patch to theexpo-nativetest app, which is not committed. It adds a Sign in with Apple button to the Native modules screen. It replacesexpo-apple-authenticationandexpo-cryptowith stubs that return a fake identity token. It also answers the twooauth_token_applerequests in the app'sfetch: sign-up withsign_up_mode_restricted(403), and sign-in withneeds_first_factorandexternal_account_email_address_verification_requiredonfirst_factor_verification. The hook itself is unpatched. Android is not covered because this hook is iOS only. The new unit test fails onmainand passes with the change.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code
Verified on an iOS simulator. Run
r20261104-100054-902aonverify-ios-1at79052077fe8c, 1 of 1 passed. Before is runr20261104-100014-16feat79052077fe8c, 0 of 1 passed.evidence-1f46ee6fc713564d-2.mp4
evidence-1f46ee6fc713564d-1.mp4