Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions GoogleSignIn/Sources/GIDSignIn.m
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
authStateMigrationService:(GIDAuthStateMigration *)authStateMigrationService {
self = [super init];
if (self) {
_keychainStore = keychainStore;

// Get the bundle of the current executable.
NSBundle *bundle = NSBundle.mainBundle;

Expand All @@ -552,19 +554,13 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
// Check to see if the 3P app is being run for the first time after a fresh install.
BOOL isFreshInstall = [self isFreshInstall];

// If this is a fresh install, ensure that any pre-existing keychain data is purged.
if (isFreshInstall) {
[self removeAllKeychainEntries];
}

NSString *authorizationEnpointURL = [NSString stringWithFormat:kAuthorizationURLTemplate,
[GIDSignInPreferences googleAuthorizationServer]];
NSString *tokenEndpointURL = [NSString stringWithFormat:kTokenURLTemplate,
[GIDSignInPreferences googleTokenServer]];
_appAuthConfiguration = [[OIDServiceConfiguration alloc]
initWithAuthorizationEndpoint:[NSURL URLWithString:authorizationEnpointURL]
tokenEndpoint:[NSURL URLWithString:tokenEndpointURL]];
_keychainStore = keychainStore;
// Perform migration of auth state from old versions of the SDK if needed.
[authStateMigrationService migrateIfNeededWithTokenURL:_appAuthConfiguration.tokenEndpoint
callbackPath:kBrowserCallbackPath
Expand Down