diff --git a/Demo/AuthenticatorDemo/ViewController+WordPressAuthenticator.swift b/Demo/AuthenticatorDemo/ViewController+WordPressAuthenticator.swift index e1d6a1142..40e50d44d 100644 --- a/Demo/AuthenticatorDemo/ViewController+WordPressAuthenticator.swift +++ b/Demo/AuthenticatorDemo/ViewController+WordPressAuthenticator.swift @@ -85,7 +85,7 @@ extension ViewController { // Note that this method does not try to authenticate the user with the WordPress backend. // It only verifies that we can get a token from Google. func getAuthTokenFromGoogle() { - Task { + Task { @MainActor in do { let token = try await self.googleAuthenticator.getOAuthToken() diff --git a/WordPressAuthenticator/Unified Auth/GoogleAuthenticator.swift b/WordPressAuthenticator/Unified Auth/GoogleAuthenticator.swift index 516309bf3..3604c308b 100644 --- a/WordPressAuthenticator/Unified Auth/GoogleAuthenticator.swift +++ b/WordPressAuthenticator/Unified Auth/GoogleAuthenticator.swift @@ -137,7 +137,7 @@ class GoogleAuthenticator: NSObject { return } - Task { + Task { @MainActor in do { let token = try await requestAuthorization( for: authType,