Skip to content

Commit f7b16ab

Browse files
authored
add explicit react native check (#217)
1 parent 71c16e5 commit f7b16ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/react/client.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@ export function AuthProvider({
243243
const url = new URL(result.redirect);
244244
await storageSet(VERIFIER_STORAGE_KEY, result.verifier!);
245245
// Do not redirect in React Native
246-
if (window.location?.href !== undefined) {
246+
// Using a deprecated property because it's the only explicit check
247+
// available, and they set it explicitly and intentionally for this
248+
// purpose.
249+
if (navigator.product !== "ReactNative") {
247250
window.location.href = url.toString();
248251
}
249252
return { signingIn: false, redirect: url };

0 commit comments

Comments
 (0)