@@ -6,6 +6,7 @@ import type {
66 NativeClearSessionOptions ,
77} from '../../../types' ;
88import {
9+ SafariViewControllerPresentationStyle ,
910 type LocalAuthenticationOptions ,
1011 type NativeAuthorizeOptions ,
1112} from '../../../types/platform-specific' ;
@@ -71,16 +72,11 @@ export class NativeBridgeManager implements INativeBridge {
7172 parameters : WebAuthorizeParameters ,
7273 options : NativeAuthorizeOptions
7374 ) : Promise < Credentials > {
74- let presentationStyle : number | undefined ;
75- if ( options . useSFSafariViewController === true ) {
76- // If just `true`, default to a safe style like `fullScreen` (value 1 from our enum)
77- presentationStyle = 1 ;
78- } else if ( typeof options . useSFSafariViewController === 'object' ) {
79- presentationStyle = options . useSFSafariViewController . presentationStyle ;
80- } else {
81- // If false or undefined, pass undefined to the native layer.
82- presentationStyle = undefined ;
83- }
75+ let presentationStyle = options . useSFSafariViewController
76+ ? ( options . useSFSafariViewController as { presentationStyle : number } )
77+ ?. presentationStyle ??
78+ SafariViewControllerPresentationStyle . fullScreen
79+ : undefined ;
8480 const scheme =
8581 parameters . redirectUrl ?. split ( '://' ) [ 0 ] ?? options . customScheme ;
8682 const credential = await this . a0_call (
@@ -97,7 +93,8 @@ export class NativeBridgeManager implements INativeBridge {
9793 parameters . invitationUrl ,
9894 options . leeway ?? 0 ,
9995 options . ephemeralSession ?? false ,
100- presentationStyle ,
96+ presentationStyle ?? 99 , // Since we can't pass null to the native layer, and we need a value to represent this parameter is not set, we are using 99.
97+ // //The native layer will check for this and ignore if the value is 99
10198 parameters . additionalParameters ?? { }
10299 ) ;
103100 return new CredentialsModel ( credential ) ;
0 commit comments