Skip to content

Commit

Permalink
Remove facebook 'already authenticating' error
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg committed Mar 21, 2012
1 parent fade284 commit 7266e64
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
6 changes: 0 additions & 6 deletions Socialize/Classes/SocializeFacebookAuthHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ - (void)authenticateWithAppId:(NSString*)appId
success:(void(^)())success
failure:(void(^)(NSError*))failure {

if (self.authenticating) {
// Authentication restarted before completion
NSError *error = [NSError defaultSocializeErrorForCode:SocializeErrorFacebookAuthRestarted];
[self failWithError:error];
}

self.authenticating = YES;
self.facebook = [[[self.facebookClass alloc] initWithAppId:appId] autorelease];
self.permissions = permissions;
Expand Down
23 changes: 0 additions & 23 deletions unitTests/Test Cases/SocializeFacebookAuthHandlerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,6 @@ - (void)testFailedAuthenticationCallsFailureHandler {
[self attemptAuthenticationAndWaitForStatus:kGHUnitWaitStatusFailure];
}

- (void)testSecondAuthAttemptCausesErrorButStillRetries {

[self ignoreFacebookAuthentication];
[self attemptAuthenticationWithSuccess:^(NSString *accessToken, NSDate *expirationDate) {
GHAssertTrue(NO, @"should not be called");
} failure:^(NSError *error) {
GHAssertTrue([error isSocializeErrorWithCode:SocializeErrorFacebookAuthRestarted], @"unexpected error");
// This is the failure block that should be called after second attempt
[self notify:kGHUnitWaitStatusFailure];
}];

[self prepare];
[self ignoreFacebookAuthentication];
[self attemptAuthenticationWithSuccess:^(NSString *accessToken, NSDate *expirationDate) {
GHAssertTrue(NO, @"should not be called");
} failure:^(NSError *error) {
GHAssertTrue(NO, @"should not be called");
}];

[self waitForStatus:kGHUnitWaitStatusFailure timeout:1.0];

}

- (void)testSharedHandler {
SocializeFacebookAuthHandler *handler = [SocializeFacebookAuthHandler sharedFacebookAuthHandler];
GHAssertNotNil(handler, @"");
Expand Down

0 comments on commit 7266e64

Please sign in to comment.