-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[google_sign_in] Add a platform interface method to clear auth tokens #9929
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
[google_sign_in] Add a platform interface method to clear auth tokens #9929
Conversation
Adds a new `clearAuthCache` method to the `google_sign_in` plugin. This method allows developers to clear the auth cache for a signed-in user. The implementation is provided for the Android and Web platforms. On Android, it calls `AuthorizationClient.clearToken`. On Web, it removes the matching entry from an in-memory cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a new clearAuthorizationToken method to the platform interface, allowing for the clearing of cached access tokens. The changes are well-structured, including the new method in the abstract class, a corresponding parameter class, and a test to ensure the default implementation throws an UnimplementedError as expected. I have one suggestion regarding a minor naming inconsistency in the documentation to improve clarity. Overall, this is a solid addition to the package.
packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart
Outdated
Show resolved
Hide resolved
bparrishMines
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
flutter/packages@2d651b2...03598e7 2025-09-10 [email protected] [url_launcher] Temporarily restore Android 21 support (flutter/packages#9986) 2025-09-10 [email protected] Roll Flutter from 973320c to a082096 (17 revisions) (flutter/packages#9983) 2025-09-09 [email protected] [various] Scrub pre-Android-API <24 code (flutter/packages#9851) 2025-09-09 [email protected] [google_sign_in] Add a platform interface method to clear auth tokens (flutter/packages#9929) 2025-09-09 [email protected] Revert "[url_launcher] fix: Link widget Tab traversal" (flutter/packages#9980) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#175185) flutter/packages@2d651b2...03598e7 2025-09-10 [email protected] [url_launcher] Temporarily restore Android 21 support (flutter/packages#9986) 2025-09-10 [email protected] Roll Flutter from 973320c to a082096 (17 revisions) (flutter/packages#9983) 2025-09-09 [email protected] [various] Scrub pre-Android-API <24 code (flutter/packages#9851) 2025-09-09 [email protected] [google_sign_in] Add a platform interface method to clear auth tokens (flutter/packages#9929) 2025-09-09 [email protected] Revert "[url_launcher] fix: Link widget Tab traversal" (flutter/packages#9980) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#175185) flutter/packages@2d651b2...03598e7 2025-09-10 [email protected] [url_launcher] Temporarily restore Android 21 support (flutter/packages#9986) 2025-09-10 [email protected] Roll Flutter from 973320c to a082096 (17 revisions) (flutter/packages#9983) 2025-09-09 [email protected] [various] Scrub pre-Android-API <24 code (flutter/packages#9851) 2025-09-09 [email protected] [google_sign_in] Add a platform interface method to clear auth tokens (flutter/packages#9929) 2025-09-09 [email protected] Revert "[url_launcher] fix: Link widget Tab traversal" (flutter/packages#9980) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…flutter#9929) Platform interface portion of flutter#9846 Part of flutter/flutter#173924 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Platform interface portion of #9846
Part of flutter/flutter#173924
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3