Skip to content
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

Canceling authorization throws CancellationException #70

Open
simonzettervall opened this issue Jan 31, 2017 · 2 comments
Open

Canceling authorization throws CancellationException #70

simonzettervall opened this issue Jan 31, 2017 · 2 comments

Comments

@simonzettervall
Copy link

The methods:

  • waitForVerifierCode()
  • waitForExplicitCode()
  • waitForImplicitResponseUrl()

in DialogFragmentController will all throw a CancellationException if a user presses back when the authorization dialog is open, which is prone to happen. I suggest removing it or making it throw another exception. The fastest way is to just throw another IOException, which is already present in the code, and let users either ignore it or take action upon it.

@simonzettervall
Copy link
Author

I fixed this by having a try catch on future.getResult() in my OAuthManager.OAuthCallback implementation.

@maestrovsmaster
Copy link

maestrovsmaster commented Mar 3, 2017

Thank you
I solved this problem in my implementation. I fixed this by having a try catch with CancellationException !

try{

.....
OAuthManager.OAuthFuture oauthFuture = oauth.authorizeExplicitly(...);
....
credential = oauthFuture.getResult();
....
catch (CancellationException e2){
Log.d(TAG, "Login cancel");
}

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

No branches or pull requests

2 participants