From 5808e5f7998eb9f70dbdfed00eb5f643ed3f10b3 Mon Sep 17 00:00:00 2001 From: ipaterson Date: Fri, 20 Sep 2013 13:19:56 -0400 Subject: [PATCH 1/2] The kBITAuthenticatorDidSkipOptionalLogin was not being reset upon cleanup because it is stored in NSUserDefaults rather than the keychain. --- Classes/BITAuthenticator.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 7f9e717433..caf536f6db 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -539,7 +539,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato - (void) cleanupInternalStorage { [self removeKeyFromKeychain:kBITAuthenticatorAuthTokenKey]; [self removeKeyFromKeychain:kBITAuthenticatorAuthTokenTypeKey]; - [self removeKeyFromKeychain:kBITAuthenticatorDidSkipOptionalLogin]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:kBITAuthenticatorDidSkipOptionalLogin]; [self setLastAuthenticatedVersion:nil]; } From 16cc6d0df592c93e9d0116dbf6a7747b892a94e4 Mon Sep 17 00:00:00 2001 From: ipaterson Date: Fri, 20 Sep 2013 13:27:59 -0400 Subject: [PATCH 2/2] Updated -testThatCleanupWorks to ensure that didSkipOptionalLogin is set to YES before cleanup, otherwise the assertion that the value is NO after cleanup is merely testing its initialization to NO. --- Support/HockeySDKTests/BITAuthenticatorTests.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Support/HockeySDKTests/BITAuthenticatorTests.m b/Support/HockeySDKTests/BITAuthenticatorTests.m index 887c354a01..26b5760b84 100644 --- a/Support/HockeySDKTests/BITAuthenticatorTests.m +++ b/Support/HockeySDKTests/BITAuthenticatorTests.m @@ -98,6 +98,7 @@ static void *kInstallationIdentification = &kInstallationIdentification; - (void) testThatCleanupWorks { [_sut setAuthenticationToken:@"MyToken" withType:@"udid"]; _sut.lastAuthenticatedVersion = @"1.2"; + [_sut setDidSkipOptionalLogin:YES]; [_sut cleanupInternalStorage];