Skip to content

Commit 2d0b5d3

Browse files
Expo web SSO - Only attempt browser warm up on android (#2623)
Co-authored-by: Alexis Aguilar <[email protected]>
1 parent 6df2725 commit 2d0b5d3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/guides/development/custom-flows/authentication/enterprise-connections.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ You must configure your application instance through the Clerk Dashboard for the
8787
import * as WebBrowser from 'expo-web-browser'
8888
import * as AuthSession from 'expo-auth-session'
8989
import { useSSO } from '@clerk/clerk-expo'
90-
import { View, Button, TextInput } from 'react-native'
90+
import { View, Button, TextInput, Platform } from 'react-native'
9191

9292
export const useWarmUpBrowser = () => {
9393
useEffect(() => {
9494
// Preloads the browser for Android devices to reduce authentication load time
9595
// See: https://docs.expo.dev/guides/authentication/#improving-user-experience
96+
if (Platform.OS !== 'android') return
9697
void WebBrowser.warmUpAsync()
9798
return () => {
9899
// Cleanup: closes browser when component unmounts

docs/guides/development/custom-flows/authentication/oauth-connections.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ You must configure your application instance through the Clerk Dashboard for the
8484
import * as WebBrowser from 'expo-web-browser'
8585
import * as AuthSession from 'expo-auth-session'
8686
import { useSSO } from '@clerk/clerk-expo'
87-
import { View, Button } from 'react-native'
87+
import { View, Button, Platform } from 'react-native'
8888

8989
export const useWarmUpBrowser = () => {
9090
useEffect(() => {
9191
// Preloads the browser for Android devices to reduce authentication load time
9292
// See: https://docs.expo.dev/guides/authentication/#improving-user-experience
93+
if (Platform.OS !== 'android') return
9394
void WebBrowser.warmUpAsync()
9495
return () => {
9596
// Cleanup: closes browser when component unmounts

0 commit comments

Comments
 (0)