ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
53 stars 54 forks source link

Closing the authentication tab keeps authenticate method running #39

Closed s9th closed 1 year ago

s9th commented 1 year ago

Describe the bug

If the authentication tab in the browser is closed before receiving the authentication result, the FlutterWebAuth2.authenticate keeps running.

To Reproduce

Steps to reproduce the behavior:

  1. Start authentication with a provider that has a dialog asking the user to approve scopes (e.g. Github with scopes repo, project)
  2. Close the github browser tab
  3. FlutterWebAuth2.authenticate runs indefinitely

Expected behavior

FlutterWebAuth2.authenticate returns null or throws an Exception

Screenshots

Line 26 is never reached if browser tab is closed image

Device (please complete the following information!)

Additional context

Checklist

ThexXTURBOXx commented 1 year ago

I also thought about some mechanism that could detect cases like this, but don't know what the best solution would be. However, I will try to fix this issue soon

DragonSlayer88 commented 1 year ago

Any update on this? Im having the same issue

ThexXTURBOXx commented 1 year ago

Sorry, no update yet as I had no time to work on it due to my master thesis

Sten435 commented 1 year ago

Any update on this?

It would be nice if we could specify a timeout duration or smtg...

ThexXTURBOXx commented 1 year ago

I am finally back from my vacation and this issue should be fixed in the new 2.2.1 release

Sten435 commented 1 year ago

I am finally back from my vacation and this issue should be fixed in the new 2.2.1 release

Thanks mate 👌

ThexXTURBOXx commented 1 year ago

The timeout is now configurable in 3.0.0-alpha.1