Skip to content

Commit cab4a1d

Browse files
authored
Remove unused code path in maybeFetchToken (#209)
1 parent 04d8fdf commit cab4a1d

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

GoogleSignIn/Sources/GIDSignIn.m

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ - (void)processAuthorizationResponse:(OIDAuthorizationResponse *)authorizationRe
629629
authFlow.authState = [[OIDAuthState alloc]
630630
initWithAuthorizationResponse:authorizationResponse];
631631
// perform auth code exchange
632-
[self maybeFetchToken:authFlow fallback:nil];
632+
[self maybeFetchToken:authFlow];
633633
} else {
634634
// There was a failure, convert to appropriate error code.
635635
NSString *errorString;
@@ -701,17 +701,14 @@ - (void)authenticateWithOptions:(GIDSignInInternalOptions *)options {
701701
// Complete the auth flow using saved auth in keychain.
702702
GIDAuthFlow *authFlow = [[GIDAuthFlow alloc] init];
703703
authFlow.authState = authState;
704-
[self maybeFetchToken:authFlow fallback:options.interactive ? ^() {
705-
[self authenticateInteractivelyWithOptions:options];
706-
} : nil];
704+
[self maybeFetchToken:authFlow];
707705
[self addDecodeIdTokenCallback:authFlow];
708706
[self addSaveAuthCallback:authFlow];
709707
[self addCompletionCallback:authFlow];
710708
}
711709

712-
// Fetches the access token if necessary as part of the auth flow. If |fallback|
713-
// is provided, call it instead of continuing the auth flow in case of error.
714-
- (void)maybeFetchToken:(GIDAuthFlow *)authFlow fallback:(nullable void (^)(void))fallback {
710+
// Fetches the access token if necessary as part of the auth flow.
711+
- (void)maybeFetchToken:(GIDAuthFlow *)authFlow {
715712
OIDAuthState *authState = authFlow.authState;
716713
// Do nothing if we have an auth flow error or a restored access token that isn't near expiration.
717714
if (authFlow.error ||
@@ -758,14 +755,6 @@ - (void)maybeFetchToken:(GIDAuthFlow *)authFlow fallback:(nullable void (^)(void
758755
[authState updateWithTokenResponse:tokenResponse error:error];
759756
authFlow.error = error;
760757

761-
if (!tokenResponse.accessToken || error) {
762-
if (fallback) {
763-
[authFlow reset];
764-
fallback();
765-
return;
766-
}
767-
}
768-
769758
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
770759
if (authFlow.emmSupport) {
771760
[GIDAuthentication handleTokenFetchEMMError:error completion:^(NSError *error) {

0 commit comments

Comments
 (0)