Permalink
Browse files

This reverts commit 74ae952.

The original behavior is the correct behavior as it prevents random errors from popping up the inline login dialog.
  • Loading branch information...
1 parent cb4b1c3 commit 3c88fd42dfbc4738688e5ee63f49ff753b562f75 Yariv Sadan committed Sep 13, 2011
Showing with 13 additions and 12 deletions.
  1. +13 −12 src/Facebook.m
View
@@ -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
@@ -346,6 +346,7 @@ - (BOOL)handleOpenURL:(NSURL *)url {
expirationDate = [NSDate dateWithTimeIntervalSinceNow:expVal];
}
}
+
[self fbDialogLogin:accessToken expirationDate:expirationDate];
return YES;
}

0 comments on commit 3c88fd4

Please sign in to comment.