1111
1212ASWebAuthenticationSession *_authSession;
1313
14- // Remove the global automation mode variable
15- static NSString* _pendingRedirectScheme = nil;
16-
1714@implementation ImmutableMac
1815
1916- (instancetype)init {
@@ -66,7 +63,7 @@ static NSString* _pendingRedirectScheme = nil;
6663 // For automation, use the browser-based method
6764 if (GIsAutomationTesting) {
6865 NSLog (@" Using automation mode for authentication (GIsAutomationTesting is true)" );
69- [self launchUrlInBrowser:url forRedirectUri:redirectUri ];
66+ [self launchUrlInBrowser:url];
7067 return ;
7168 }
7269
@@ -107,7 +104,7 @@ static NSString* _pendingRedirectScheme = nil;
107104 }
108105}
109106
110- - (void )launchUrlInBrowser:(const char *)url forRedirectUri:( const char *)redirectUri {
107+ - (void )launchUrlInBrowser:(const char *)url {
111108 // Add redundant check to ensure this only runs for automated testing
112109 if (!GIsAutomationTesting) {
113110 return ;
@@ -116,29 +113,6 @@ static NSString* _pendingRedirectScheme = nil;
116113 // Create URL object
117114 NSURL *URL = [NSURL URLWithString:[[NSString alloc] initWithUTF8String:url]];
118115
119- // Extract the callback scheme from redirect URI
120- NSString *redirectUriString = [[NSString alloc] initWithUTF8String:redirectUri];
121- NSString *callbackURLScheme = [[redirectUriString componentsSeparatedByString:@" :" ] objectAtIndex:0 ];
122-
123- // Store the redirect scheme for use when handling the callback
124- _pendingRedirectScheme = callbackURLScheme;
125-
126- // Register for custom URL scheme notifications (will need to be implemented in AppDelegate)
127- [[NSNotificationCenter defaultCenter] addObserverForName:@" ImmutableCustomURLSchemeCallback"
128- object:nil
129- queue:[NSOperationQueue mainQueue]
130- usingBlock:^(NSNotification *notification) {
131- if (notification.userInfo ) {
132- NSString *callbackURLString = notification.userInfo [@" url" ];
133- if (callbackURLString) {
134- UImmutablePassport* passport = [ImmutableMac getPassport];
135- if (passport) {
136- passport->HandleDeepLink (callbackURLString);
137- }
138- }
139- }
140- }];
141-
142116 // Open URL in default browser
143117 [[NSWorkspace sharedWorkspace] openURL:URL];
144118 NSLog (@" Opened URL in browser for automation: %@" , URL);
0 commit comments