firebase_auth_mocks
firebase_auth_mocks copied to clipboard
Added getIdTokenResult support
What this PR contains Added support for mocking getIdTokenResult. Most useful for custom claims, which can be used for role-based access control.
- Adds
IdTokenResult? _idTokenResultprivate property in MockUser - Adds
IdTokenResult? idTokenResultoptional property for MockUser constructor - Overrides
dart Future<IdTokenResult> getIdTokenResult([bool forceRefresh = false])in MockUser to return the the _idTokenResult property as a Future value - Adds idTokenResult mock data to the test user in firebase_auth_mocks_test.dart
Thanks for the PR @simplecohesion. Would you mind writing a unit test as well to show how it works, and prevent others from accidentally breaking your code in the future?
Hey @atn832 , any updates on this?
Thanks for proposing this PR. I just merged #73 since it came with tests.