Skip to content

Commit ec10fa2

Browse files
chore: clean up
1 parent 5c5b89b commit ec10fa2

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
ASWebAuthenticationSession *_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);

Source/Immutable/Private/Immutable/Mac/ImmutableMac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
: NSObject <ASWebAuthenticationPresentationContextProviding>
88
+ (ImmutableMac *)instance;
99
- (void)launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri;
10-
- (void)launchUrlInBrowser:(const char *)url forRedirectUri:(const char *)redirectUri;
10+
- (void)launchUrlInBrowser:(const char *)url;
1111
@end

0 commit comments

Comments
 (0)