signInWithCustomToken method

Future<FirebaseAccount> signInWithCustomToken(
  1. String token, {
  2. bool autoRefresh = true,
})

Signs into firebase with a custom token.

This logs into an exsiting account and returns it's credentials as FirebaseAccount if the request succeeds, or throws an AuthException if it fails.

If autoRefresh is enabled (the default), the created accounts FirebaseAccount.autoRefresh is set to true as well, wich will start an automatic token refresh in the background, as soon as the current token comes close to expiring. See FirebaseAccount.autoRefresh for more details.

Implementation

Future<FirebaseAccount> signInWithCustomToken(
  String token, {
  bool autoRefresh = true,
}) async =>
    FirebaseAccount.apiCreate(
      api,
      await api.signInWithCustomToken(
        CustomTokenSignInRequest(
          token: token,
        ),
      ),
      autoRefresh: autoRefresh,
      locale: locale,
    );