google / googleapis.dart

Repository for building the googleapis packages
https://pub.dev/packages/googleapis
BSD 3-Clause "New" or "Revised" License
393 stars 119 forks source link

Handle Auth popup close #607

Closed HE-LU closed 7 months ago

HE-LU commented 7 months ago

CodeClientConfig was missing error_callback. This made it impossible to detect popup close.

Probably the biggest issue of not having this error_callback is that the Future will actually never complete when the user closes the popup. The app will hang on the await infinitely.

final authCode = await requestAuthorizationCode(
...

Handling this using exception is inspired by google_sign_in_web, which is doing it the same way.

google-cla[bot] commented 7 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

kevmoo commented 7 months ago

Published with this fix. Thanks!