Skip to content

Commit 04d8fdf

Browse files
authored
Dry up auth flow. (#208)
1 parent 8af6100 commit 04d8fdf

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

GoogleSignIn/Sources/GIDSignIn.m

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ - (void)authenticateInteractivelyWithOptions:(GIDSignInInternalOptions *)options
589589
additionalParameters[kSDKVersionLoggingParameter] = GIDVersion();
590590
additionalParameters[kEnvironmentLoggingParameter] = GIDEnvironment();
591591

592-
#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
593592
OIDAuthorizationRequest *request =
594593
[[OIDAuthorizationRequest alloc] initWithConfiguration:_appAuthConfiguration
595594
clientId:options.configuration.clientID
@@ -600,34 +599,17 @@ - (void)authenticateInteractivelyWithOptions:(GIDSignInInternalOptions *)options
600599

601600
_currentAuthorizationFlow = [OIDAuthorizationService
602601
presentAuthorizationRequest:request
602+
#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
603603
presentingViewController:options.presentingViewController
604-
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
605-
NSError *_Nullable error) {
606-
[self processAuthorizationResponse:authorizationResponse
607-
error:error
608-
emmSupport:emmSupport];
609-
}];
610604
#elif TARGET_OS_OSX
611-
OIDAuthorizationRequest *request =
612-
[[OIDAuthorizationRequest alloc] initWithConfiguration:_appAuthConfiguration
613-
clientId:options.configuration.clientID
614-
clientSecret:@""
615-
scopes:options.scopes
616-
redirectURL:redirectURL
617-
responseType:OIDResponseTypeCode
618-
additionalParameters:additionalParameters];
619-
620-
_currentAuthorizationFlow = [OIDAuthorizationService
621-
presentAuthorizationRequest:request
622605
presentingWindow:options.presentingWindow
623-
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
624-
NSError *_Nullable error) {
606+
#endif // TARGET_OS_OSX
607+
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
608+
NSError *_Nullable error) {
625609
[self processAuthorizationResponse:authorizationResponse
626610
error:error
627611
emmSupport:emmSupport];
628612
}];
629-
#endif // TARGET_OS_OSX
630-
631613
}
632614

633615
- (void)processAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse

0 commit comments

Comments
 (0)