|
1 | 1 | #include "ImmutableMac.h"
|
| 2 | + |
| 3 | +#include "Engine/GameEngine.h" |
| 4 | + |
2 | 5 | #include "Immutable/ImmutablePassport.h"
|
3 | 6 | #include "Immutable/ImmutableSubsystem.h"
|
4 |
| -#include "Engine/GameEngine.h" |
5 | 7 |
|
6 | 8 | #if WITH_EDITOR
|
7 | 9 | #include "Editor.h"
|
@@ -67,6 +69,13 @@ ASWebAuthenticationSession *_authSession;
|
67 | 69 | }
|
68 | 70 |
|
69 | 71 | - (void)launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri {
|
| 72 | + // For automation, use the browser-based method |
| 73 | + if (GIsAutomationTesting) { |
| 74 | + NSLog(@"Using automation mode for authentication (GIsAutomationTesting is true)"); |
| 75 | + [self launchUrlInBrowser:url]; |
| 76 | + return; |
| 77 | + } |
| 78 | + |
70 | 79 | if (@available(macOS 10.15, *)) {
|
71 | 80 | NSURL *URL =
|
72 | 81 | [NSURL URLWithString:[[NSString alloc] initWithUTF8String:url]];
|
@@ -104,6 +113,20 @@ ASWebAuthenticationSession *_authSession;
|
104 | 113 | }
|
105 | 114 | }
|
106 | 115 |
|
| 116 | +- (void)launchUrlInBrowser:(const char *)url { |
| 117 | + // Add redundant check to ensure this only runs for automated testing |
| 118 | + if (!GIsAutomationTesting) { |
| 119 | + return; |
| 120 | + } |
| 121 | + |
| 122 | + // Create URL object |
| 123 | + NSURL *URL = [NSURL URLWithString:[[NSString alloc] initWithUTF8String:url]]; |
| 124 | + |
| 125 | + // Open URL in default browser |
| 126 | + [[NSWorkspace sharedWorkspace] openURL:URL]; |
| 127 | + NSLog(@"Opened URL in browser for automation: %@", URL); |
| 128 | +} |
| 129 | + |
107 | 130 | - (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:
|
108 | 131 | (ASWebAuthenticationSession *)session API_AVAILABLE(macos(10.15)) {
|
109 | 132 | return [[[NSApplication sharedApplication] windows] firstObject];
|
|
0 commit comments