philippec / PhFacebook

MacOSX Interface to Facebook graph API
http://developer.casgrain.com/?p=107
Other
178 stars 44 forks source link

Problem when user has enabled Facebook's enhanced security features #40

Closed raffael closed 9 years ago

raffael commented 11 years ago

Hey, I'm not quite sure what's happening here, maybe Facebook has silently changed something in the Login process: The user can activate a security feature in his FB settings, which requires to specify a Device name everytime someone is trying to log in with his Facebook account. This all worked fine with PhFacebook, until now: After logging in using the credentials, the "Specify the device" form appears. As soon as this is submitted, a blank page appears in the Auth dialogue and the window doesn't hide itself — the whole login process is stuck.

To fix that, I tested the following which seems to work: in PhWebViewController.m, in the didFinishLoadForFrame; insert the following code after *urlWithoutSchema processing:

if (sender!=nil) { NSString *html = [sender stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"]; if (html==nil || [html isEqualToString:@""]) { [parent performSelector: @selector(didDismissUI)]; [self.window orderOut: self]; return; } }

It will dismiss the window and the login process is finished. Don't know if it's safe to use this approach though.

philippec commented 11 years ago

Did you deploy this code in the field? Did it work for you? I can't replicate the conditions you describe, so it makes it hard for me to review and incorporate the code...

philippec commented 9 years ago

No activity in two years, closing.