Skip to content

Commit

Permalink
This reverts commit 74ae952.
Browse files Browse the repository at this point in the history
The original behavior is the correct behavior as it prevents random errors from popping up the inline login dialog.
  • Loading branch information
Yariv Sadan committed Sep 13, 2011
1 parent cb4b1c3 commit 3c88fd4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Facebook.m
Expand Up @@ -312,18 +312,18 @@ - (BOOL)handleOpenURL:(NSURL *)url {
if (!accessToken) {
NSString *errorReason = [params valueForKey:@"error"];

if (errorReason) {
// If the error response indicates that we should try again using Safari, open
// the authorization dialog in Safari.
if ([errorReason isEqualToString:@"service_disabled_use_browser"]) {
[self authorizeWithFBAppAuth:NO safariAuth:YES];
}
// Any other error response indicates that we should try the authorization flow
// in an inline dialog
else {
[self authorizeWithFBAppAuth:NO safariAuth:NO];
}
return YES;
// If the error response indicates that we should try again using Safari, open
// the authorization dialog in Safari.
if (errorReason && [errorReason isEqualToString:@"service_disabled_use_browser"]) {
[self authorizeWithFBAppAuth:NO safariAuth:YES];
return YES;
}

// If the error response indicates that we should try the authorization flow
// in an inline dialog, do that.
if (errorReason && [errorReason isEqualToString:@"service_disabled"]) {
[self authorizeWithFBAppAuth:NO safariAuth:NO];
return YES;
}

// The facebook app may return an error_code parameter in case it
Expand All @@ -346,6 +346,7 @@ - (BOOL)handleOpenURL:(NSURL *)url {
expirationDate = [NSDate dateWithTimeIntervalSinceNow:expVal];
}
}

[self fbDialogLogin:accessToken expirationDate:expirationDate];
return YES;
}
Expand Down

0 comments on commit 3c88fd4

Please sign in to comment.