Skip to content

Commit

Permalink
feat: Update fetchJwt method to support force refresh (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
naipaka committed Dec 26, 2023
1 parent 5b87f28 commit f91aa75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/altfire_authenticator/lib/src/authenticator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class Authenticator {

/// 現ユーザーのJWT(JSON Web Token)を非同期で取得する。
/// 未サインイン時など、現ユーザーが存在しない場合はnullを返す。
Future<String?>? get fetchJwt => _auth.currentUser?.getIdToken();
/// forceRefreshが`true`の場合、トークンを強制的に更新する。
Future<String?>? fetchJwt({bool forceRefresh = false}) =>
_auth.currentUser?.getIdToken(forceRefresh);

/// 匿名サインイン
Future<UserCredential> signInAnonymously() async {
Expand Down

0 comments on commit f91aa75

Please sign in to comment.