twitter-archive / twitter-kit-ios

Twitter Kit is a native SDK to include Twitter content inside mobile apps.
Apache License 2.0
690 stars 448 forks source link

fix handling of SFSafariViewController redirect when user cancels aut… #24

Closed nsalmoria closed 6 years ago

nsalmoria commented 6 years ago

…hentication.

The code that processes the URL used to redirect to the app after the web authentication expects a "oauth_token" parameter.

However, if the user cancels the sign-in procedure and clicks the "Return to \<app>" button, the URL doesn't contain such a parameter; it only contains a "denied" parameter, whose argument is the aoth token. I.e.: "twitterkit-\<consumer key>://callback?app=\<consumer key>&denied=\<oauth token>".

This change looks for the "denied" parameter in case the "oath_token" parameter can't be found, so that the redirect can complete successfully.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

rajul-arora commented 6 years ago

This has been merged internally and will be added as part of the next TwitterKit release!