Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/expo-use-oauth-missing-redirect-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/expo': patch
---

Fix the deprecated `useOAuth()` hook crashing when the sign-in attempt has no external verification redirect URL. It now throws a Clerk error, matching `useSSO()`.
4 changes: 3 additions & 1 deletion packages/expo/src/hooks/useOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ export function useOAuth(useOAuthParams: UseOAuthFlowParams) {
await signIn.create({ strategy, redirectUrl: oauthRedirectUrl });

const { externalVerificationRedirectURL } = signIn.firstFactorVerification;
if (!externalVerificationRedirectURL) {
return errorThrower.throw('Missing external verification redirect URL for OAuth flow');
}

const authSessionResult = await WebBrowserModule.openAuthSessionAsync(
// @ts-ignore
externalVerificationRedirectURL.toString(),
oauthRedirectUrl,
);
Expand Down
Loading