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

🔀 address issue #30; test issues #1, #10, #13 #47

Closed FireJuun closed 1 year ago

FireJuun commented 1 year ago

This PR should help users who are using flutter_web_auth_2 on macOS.

When first running FlutterWebAuth2.authenticate() with version 2.1.4 on macOS, I was getting the exact issue as was noted in issue #30:

flutter_web_auth_2/FlutterWebAuth2Plugin.swift:39: Fatal error: Unexpectedly found nil while unwrapping an Optional value

I believe this platform exception is what you were referencing in issue #10, though there isn't enough detail to know this for sure. Also of note, Chrome is my default browser (testing #13).

To address issue #30, I did the following:

Of note, while making these changes, I also addressed this issue in the test/flutter_web_auth_2_test.dart file:

The end result is a working example for macOS in Chrome: macos-webauth-example

ThexXTURBOXx commented 1 year ago

First of all: Thanks for your PR! However, this does not seem to fix anything in flutter_web_auth_2 directly, but rather addresses some issues in the example and tests. The issues you mentioned will then still persist in other users' devices. Do you have any idea to fix the underlying issue instead of just the example and tests?