From bf02dd0c589bf9eb99f60b38751074b68e5bbb43 Mon Sep 17 00:00:00 2001 From: Peter Andrews Date: Thu, 1 Sep 2022 00:01:46 -0700 Subject: [PATCH] Dry up auth flow. --- GoogleSignIn/Sources/GIDSignIn.m | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/GoogleSignIn/Sources/GIDSignIn.m b/GoogleSignIn/Sources/GIDSignIn.m index 7a810445..7089f0ac 100644 --- a/GoogleSignIn/Sources/GIDSignIn.m +++ b/GoogleSignIn/Sources/GIDSignIn.m @@ -589,7 +589,6 @@ - (void)authenticateInteractivelyWithOptions:(GIDSignInInternalOptions *)options additionalParameters[kSDKVersionLoggingParameter] = GIDVersion(); additionalParameters[kEnvironmentLoggingParameter] = GIDEnvironment(); -#if TARGET_OS_IOS || TARGET_OS_MACCATALYST OIDAuthorizationRequest *request = [[OIDAuthorizationRequest alloc] initWithConfiguration:_appAuthConfiguration clientId:options.configuration.clientID @@ -600,34 +599,17 @@ - (void)authenticateInteractivelyWithOptions:(GIDSignInInternalOptions *)options _currentAuthorizationFlow = [OIDAuthorizationService presentAuthorizationRequest:request +#if TARGET_OS_IOS || TARGET_OS_MACCATALYST presentingViewController:options.presentingViewController - callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse, - NSError *_Nullable error) { - [self processAuthorizationResponse:authorizationResponse - error:error - emmSupport:emmSupport]; - }]; #elif TARGET_OS_OSX - OIDAuthorizationRequest *request = - [[OIDAuthorizationRequest alloc] initWithConfiguration:_appAuthConfiguration - clientId:options.configuration.clientID - clientSecret:@"" - scopes:options.scopes - redirectURL:redirectURL - responseType:OIDResponseTypeCode - additionalParameters:additionalParameters]; - - _currentAuthorizationFlow = [OIDAuthorizationService - presentAuthorizationRequest:request presentingWindow:options.presentingWindow - callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse, - NSError *_Nullable error) { +#endif // TARGET_OS_OSX + callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse, + NSError *_Nullable error) { [self processAuthorizationResponse:authorizationResponse error:error emmSupport:emmSupport]; }]; -#endif // TARGET_OS_OSX - } - (void)processAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse