Skip to content

Commit 47b0a73

Browse files
committed
Revert "Dry up auth flow. (#208)"
This reverts commit 04d8fdf.
1 parent 12894ff commit 47b0a73

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

GoogleSignIn/Sources/GIDSignIn.m

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

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

600601
_currentAuthorizationFlow = [OIDAuthorizationService
601602
presentAuthorizationRequest:request
602-
#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
603603
presentingViewController:options.presentingViewController
604-
#elif TARGET_OS_OSX
605-
presentingWindow:options.presentingWindow
606-
#endif // TARGET_OS_OSX
607604
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
608605
NSError *_Nullable error) {
609606
[self processAuthorizationResponse:authorizationResponse
610607
error:error
611608
emmSupport:emmSupport];
612609
}];
610+
#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
622+
presentingWindow:options.presentingWindow
623+
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
624+
NSError *_Nullable error) {
625+
[self processAuthorizationResponse:authorizationResponse
626+
error:error
627+
emmSupport:emmSupport];
628+
}];
629+
#endif // TARGET_OS_OSX
630+
613631
}
614632

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

0 commit comments

Comments
 (0)