Merge pull request #61 from Newstex/pull-requests/auth-skip-cleanup

fix didSkipOptionalLogin not cleaned up properly
This commit is contained in:
Stephan Diederich
2013-09-21 03:24:16 -07:00
2 changed files with 2 additions and 1 deletions

View File

@@ -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];
}

View File

@@ -98,6 +98,7 @@ static void *kInstallationIdentification = &kInstallationIdentification;
- (void) testThatCleanupWorks {
[_sut setAuthenticationToken:@"MyToken" withType:@"udid"];
_sut.lastAuthenticatedVersion = @"1.2";
[_sut setDidSkipOptionalLogin:YES];
[_sut cleanupInternalStorage];