firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.46k stars 3.91k forks source link

fix(auth, windows): allow `idToken` and `accessToken` to be nullable to stop windows crashing for `signInWithCredential()` #12688

Closed russellwheatley closed 1 month ago

russellwheatley commented 1 month ago

Description

GoogleAuthProvider can have nullable idToken and accessToken. See underlying implementation: https://github.com/firebase/firebase-cpp-sdk/blob/e877b22faf5d4b2ad8080179369050ef6c15a2d8/auth/src/desktop/auth_providers/google_auth_provider.cc#L26-L38

I wrote a test to prove you can now pass null values for either idToken and accessToken but unfortunately the file had to be formatted so it is lost in the diff. Here it is: https://github.com/firebase/flutterfire/pull/12688/files#diff-dd4162c32c7a0146e8a9c7874e8642422e51160833ff49eea64c852b8b215ef9R659-R693

I also tested example app with changes to prove Google auth still works on windows: image (3)

fixes https://github.com/firebase/flutterfire/issues/12613

Related Issues

Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?