Просмотр исходного кода

Return focus to app after Google OAuth callback.

Activate the macOS app as soon as the loopback redirect arrives so users are brought back immediately instead of staying on the browser page.

Made-with: Cursor
huzaifahayat12 1 месяц назад
Родитель
Сommit
cd581796a0
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      meetings_app/Auth/GoogleOAuthService.swift

+ 4 - 0
meetings_app/Auth/GoogleOAuthService.swift

@@ -389,6 +389,10 @@ private final class OAuthLoopbackServer {
389
 
389
 
390
             if let parsedURL {
390
             if let parsedURL {
391
                 self.callbackURL = parsedURL
391
                 self.callbackURL = parsedURL
392
+                DispatchQueue.main.async {
393
+                    // Bring the app back to foreground once OAuth redirects.
394
+                    NSApp.activate(ignoringOtherApps: true)
395
+                }
392
                 if let continuation = self.callbackContinuation {
396
                 if let continuation = self.callbackContinuation {
393
                     self.callbackContinuation = nil
397
                     self.callbackContinuation = nil
394
                     continuation.resume(returning: parsedURL)
398
                     continuation.resume(returning: parsedURL)