Skip to content

Commit 3135cf3

Browse files
committed
changes from review
1 parent 5d0c8a8 commit 3135cf3

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

GoogleSignIn/Sources/GIDAuthStateMigration/Fake/GIDFakeAuthStateMigration.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore {
2727
return self;
2828
}
2929

30-
- (instancetype)init {
31-
return self;
32-
}
33-
3430
- (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
3531
callbackPath:(NSString *)callbackPath
3632
keychainName:(NSString *)keychainName

GoogleSignIn/Sources/GIDSignIn.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ + (GIDSignIn *)sharedInstance {
491491
GTMKeychainStore *keychainStore =
492492
[[GTMKeychainStore alloc] initWithItemName:kGTMAppAuthKeychainName];
493493
GIDAuthStateMigration *authStateMigrationService =
494-
[[GIDAuthStateMigration alloc] initWithKeychainStore:keychainStore];
494+
[[GIDAuthStateMigration alloc] initWithKeychainStore:keychainStore];
495495
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
496496
if (@available(iOS 14.0, *)) {
497497
GIDAppCheck *appCheck = [GIDAppCheck appCheckUsingAppAttestProvider];
@@ -501,7 +501,8 @@ + (GIDSignIn *)sharedInstance {
501501
}
502502
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
503503
if (!sharedInstance) {
504-
sharedInstance = [[self alloc] initWithKeychainStore:keychainStore authStateMigrationService:authStateMigrationService];
504+
sharedInstance = [[self alloc] initWithKeychainStore:keychainStore
505+
authStateMigrationService:authStateMigrationService];
505506
}
506507
});
507508
return sharedInstance;
@@ -566,9 +567,9 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
566567
_keychainStore = keychainStore;
567568
// Perform migration of auth state from old versions of the SDK if needed.
568569
[authStateMigrationService migrateIfNeededWithTokenURL:_appAuthConfiguration.tokenEndpoint
569-
callbackPath:kBrowserCallbackPath
570-
keychainName:kGTMAppAuthKeychainName
571-
isFreshInstall:isFreshInstall];
570+
callbackPath:kBrowserCallbackPath
571+
keychainName:kGTMAppAuthKeychainName
572+
isFreshInstall:isFreshInstall];
572573
}
573574
return self;
574575
}
@@ -577,7 +578,8 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
577578
- (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
578579
authStateMigrationService:(GIDAuthStateMigration *) authStateMigrationService
579580
appCheck:(GIDAppCheck *)appCheck {
580-
self = [self initWithKeychainStore:keychainStore authStateMigrationService:authStateMigrationService];
581+
self = [self initWithKeychainStore:keychainStore
582+
authStateMigrationService:authStateMigrationService];
581583
if (self) {
582584
_appCheck = appCheck;
583585
_configureAppCheckCalled = NO;

GoogleSignIn/Tests/Unit/GIDSignInTest.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,13 @@ - (void)testInitWithKeychainStore_attemptsMigration {
502502

503503
XCTestExpectation *expectation = [self expectationWithDescription:@"Callback should be called."];
504504
_authStateMigrationService.migrationInvokedCallback =
505-
^(NSURL *tokenURL, NSString *callbackPath, NSString *keychainName, BOOL isFreshInstall) {
506-
XCTAssertFalse(isFreshInstall);
507-
[expectation fulfill];
508-
};
505+
^(NSURL *tokenURL, NSString *callbackPath, NSString *keychainName, BOOL isFreshInstall) {
506+
XCTAssertFalse(isFreshInstall);
507+
[expectation fulfill];
508+
};
509509

510510
GTMKeychainStore *store = [[GTMKeychainStore alloc] initWithItemName:expectedKeychainName];
511-
GIDSignIn *signIn;
512-
signIn = [[GIDSignIn alloc] initWithKeychainStore:store
511+
GIDSignIn *signIn = [[GIDSignIn alloc] initWithKeychainStore:store
513512
authStateMigrationService:_authStateMigrationService];
514513

515514
[self waitForExpectationsWithTimeout:1 handler:nil];

0 commit comments

Comments
 (0)