Skip to content

[firebase_auth] getIdToken use actual refresh value instead of checking if object exists #1334

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

Merged
merged 7 commits into from
Nov 13, 2019

Conversation

AlexZaiats
Copy link
Contributor

@AlexZaiats AlexZaiats commented Oct 31, 2019

Description

Currently, we have different behavior in Android and iOS implementation for token refreshing. On Android we are expecting to get a boolean value, so everything works as expected:
getIdToken(refresh: false) - will not update token and getIdToken(refresh: true) will refresh it.
On iOS we are checking if refresh object exists in the dictionary, so getIdToken(refresh: false) will force token refreshing.

Related Issues

#847

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

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

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@AlexZaiats AlexZaiats force-pushed the auth_refresh_issue_847 branch from c3288ea to e9bf106 Compare November 7, 2019 16:02
Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great. I especially appreciate that you added an integration test.

## 0.14.0+7

* Remove AndroidX warning.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@AlexZaiats AlexZaiats force-pushed the auth_refresh_issue_847 branch from 3206c6f to 6aa503e Compare November 8, 2019 10:27
@AZaiats
Copy link

AZaiats commented Nov 12, 2019

@kroikie Will highly appreciate your review

Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be ready to land as soon as the CI is passing.

Copy link
Collaborator

@kroikie kroikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @AlexZaiats

@collinjackson collinjackson merged commit 06e8e3b into firebase:master Nov 13, 2019
thatfiredev pushed a commit to thatfiredev/flutterfire that referenced this pull request Nov 26, 2019
* bump core version to 0.4.1+4 (firebase#1395)

* Remove deprecated firebase-core dependency (firebase#1417)

* Remove deprecated firebase-core dependency

* [firebase_auth] getIdToken use actual refresh value instead of checking if object exists (firebase#1334)

* getIdToken use actual refresh value instead of checking if object exists

* getIdToken refresh integration test

* update xcode to v11 (firebase#1420)

* Update FirebaseApp creation in tests (firebase#1406)

* [firebase_database] Support v2 android embedder. (firebase#287)

* [firebase_remote_config] Support v2 android embedder. (firebase#282)

* [CI] Add version to example apps (firebase#1426)

* Add hardcode version to example apps

* [firebase_core] Add platform interface (firebase#1324)

* Move firebase_core to firebase_core/firebase_core
* Add firebase_core_platform_interface package
* Update cirrus scripts and documentation

* [firebase_dynamic_links] Add support of expanding from short links (firebase#1381)

* Fixes strict compilation errors. (firebase#1331)

* Upgrade crashlytics to v2 plugin API (firebase#1370)

* Upgraded Crashlytics to v2 of Flutter Plugins.

* Format documentation lists (See also & Errors) correctly (firebase#298)

Fix documentation list format.

* [firebase_auth] Fix NoSuchMethodError exception in `reauthenticateWithCredential` (firebase#237)

* [firebase_auth] Fix NoSuchMethodError exception

Fix NoSuchMethodError exception when calling FirebaseUser.reauthenticateWithCredential

* add integration test

* Fix analyzer warnings

Co-Authored-By: Collin Jackson <[email protected]>

* [cloud_firestore] [firebase_performance] fix analyzer warnings (firebase#1453)

* fix analyzer warnings

* [CI] Skip flaky firebase_performance driver tests (firebase#1452)

* Skip flaky firebase_performance driver tests

* [firebase_auth] Added missing Exception to the reauthenticateWithCredential docs (firebase#1448) (firebase#1449)

* Added missing Exception to the reauthenticateWithCredential docs (firebase#1448)

* [firebase_remote_config] Bumps Android Firebase dependency to 19.0.3 (firebase#1443)

* Bump AGP, Gradle & Google Services Plugin

* Bumps dependency to Firebase Config 19.0.3

* Replaces a deprecated method usage with the updated version

* [firebase_messaging] Use UNUserNotificationCenter for ios 10+ (firebase#121)

* Use UNUserNotificationCenter for ios 10+

* Add swift documentation

* Move http test to README

* Update CONTRIBUTING.md (firebase#1473)

Removes obsolete recommendations about removing mockito (which is now used in testing federated plugins).

* [firebase_core] Migrate to platform_interface (firebase#1472)

* [firebase_messaging] Add an ArgumentError when passing invalid background message (firebase#252)

* [firebase_dynamic_links] support v2 embedding (firebase#1372)

* [cloud_firestore] Fix test that used FirebaseApp.channel (firebase#1476)

* [cloud_firestore] Fix test that used FirebaseApp.channel

* dartfmt

* bump version

* Fixed dynamic issue

* Fixed dynamic issue

* FIxed Object to list of object mapping

* Fixed text result expectation

* Reverted some changes

* Satisfying formatter

* Added android x to pass the test

* Fixed changed log auto formatting
@firebase firebase locked and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants