Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[firebase_auth] Fix getIdToken refresh param on iOS (#1869)
Browse files Browse the repository at this point in the history
* Fix refresh param on getIdToken iOS.

* Update authors.
  • Loading branch information
lukaspili authored and collinjackson committed Jul 18, 2019
1 parent 634d80c commit 80e21e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Jonathan Younger <jonathan@daikini.com>
Jose Sanchez <josesm82@gmail.com>
Debkanchan Samadder <debu.samadder@gmail.com>
Audrius Karosevicius <audrius.karosevicius@gmail.com>
Lukasz Piliszczuk <lukasz@intheloup.io>
4 changes: 4 additions & 0 deletions packages/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.11.1+11

* On iOS, `getIdToken()` now uses the `refresh` parameter instead of always using `true`.

## 0.11.1+10

* On Android, `providerData` now includes `UserInfo` for the phone authentication provider.
Expand Down
4 changes: 3 additions & 1 deletion packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
[self sendResult:result forObject:nil error:nil];
}
} else if ([@"getIdToken" isEqualToString:call.method]) {
NSDictionary *args = call.arguments;
BOOL refresh = [args objectForKey:@"refresh"];
[[self getAuth:call.arguments].currentUser
getIDTokenForcingRefresh:YES
getIDTokenForcingRefresh:refresh
completion:^(NSString *_Nullable token, NSError *_Nullable error) {
[self sendResult:result forObject:token error:error];
}];
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
like Google, Facebook and Twitter.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
version: "0.11.1+10"
version: "0.11.1+11"

flutter:
plugin:
Expand Down

0 comments on commit 80e21e0

Please sign in to comment.