Skip to content

App crash: Canceling Twitter authentication makes application to Crash #1566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsp1589 opened this issue Oct 23, 2020 · 0 comments · Fixed by #1567
Closed

App crash: Canceling Twitter authentication makes application to Crash #1566

dsp1589 opened this issue Oct 23, 2020 · 0 comments · Fixed by #1567

Comments

@dsp1589
Copy link
Contributor

dsp1589 commented Oct 23, 2020

[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

@dsp1589 dsp1589 closed this as completed Oct 23, 2020
@dsp1589 dsp1589 reopened this Oct 23, 2020
drdaz pushed a commit that referenced this issue Nov 9, 2020
* Looking for Oauth and denied params

* updated test cases and removed 'and' condition  for successful redirection(made or to check for 'oauth_verifier' or 'oauth_token'

* Update Gemfile.lock

reverting gemlock

Co-authored-by: dhana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant