restore static method

Future<FirebaseAccount> restore(
  1. Client client,
  2. String apiKey,
  3. String refreshToken, {
  4. bool autoRefresh = true,
  5. String? locale,
})

Restores an account by using a refresh token to log the user in again.

If a user has logged in once normally, you can store the refreshToken and the later use this method to recreate the account instance without the user logging in again. Internally, this method calls refresh() to obtain user credentails and the returns a newly created account from the result.

The account is created by using the client and apiKey for accessing the Firebase REST endpoints. If autoRefresh and locale are used to initialize these properties.

If the refreshing fails, an AuthError will be thrown.

Implementation

static Future<FirebaseAccount> restore(
  Client client,
  String apiKey,
  String refreshToken, {
  bool autoRefresh = true,
  String? locale,
}) =>
    apiRestore(
      RestApi(client, apiKey),
      refreshToken,
      autoRefresh: autoRefresh,
      locale: locale,
    );