Skip to content

Commit

Permalink
fix: dismiss browser on ios
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Dec 4, 2024
1 parent 42ccda0 commit 2b97054
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useGlobalSearchParams } from 'expo-router'
import * as WebBrowser from 'expo-web-browser'
import type { CredentialDisplay } from 'packages/agent/src'
import { useEffect, useState } from 'react'
import { Platform } from 'react-native'

export type AuthCodeFlowDetails = {
domain: string
Expand Down Expand Up @@ -43,7 +44,11 @@ export const AuthCodeFlowSlide = ({
// a native app) and thus we need to manually dimiss the auth session
// and instead use the auth code from there.
if (credentialAuthorizationCode) {
WebBrowser.dismissAuthSession()
// Not available on Android
if (Platform.OS === 'ios') {
WebBrowser.dismissAuthSession()
}

setHasHandledResult(true)
onNext()
onAuthFlowCallback(credentialAuthorizationCode)
Expand Down

0 comments on commit 2b97054

Please sign in to comment.