Description
[Similar Issue : Twitter login cancellation crashes app #1474]
Application crashes when user tries to cancel the twitter authentication flow by tapping cancel button(not X in top right corner of the dialog) in twitter web page.
When user cancels the authentication twitter redirects the app to successcallback with query parameter "denied". But Parse have the logic to check the prefix of the url is success or not and no inspecting of query params which led to success callback with user name from twitter as 'nil'. nil user name is tried to insert into nsdictionary crashes the app. (see this comment : #1474 (comment))
In the file : PFOAuth1FlowDialog.m
NSURL *url = navigationAction.request.URL; BOOL hasPrefix = [url.absoluteString hasPrefix:self.redirectURLPrefix]; if (hasPrefix) { [self _dismissWithSuccess:YES url:url error:nil];
Example redirection url from twitter:
Denied Status:
http://twitter-oauth.anydomain/?denied=EgIE9gAAAAAAuhSSAAABdVPiNbM
Success Status:
http://twitter-oauth.anydomain/?oauth_token=TOKEN_VALUE&oauth_verifier=ALPHA_NUMERIC_STRING