reauth method

Future<Authentication> reauth(
  1. ReAuthProvider provider
)

If you are signed in, this is used to perform an authentication check just before changing information for authentication (e.g., email address).

Reauthentication is performed by passing a class inheriting from ReAuthProvider in provider.

Throws Exception if you are not signed in or your password is incorrect.

サインインしている場合、認証用の情報(メールアドレスなど)を変更する直前に認証チェックを行うために利用します。

ReAuthProviderを継承したクラスをproviderで渡すことにより、再認証を行ないます。

サインインしていない場合やパスワードが間違っていた場合Exceptionをスローします。

Implementation

Future<Authentication> reauth(
  ReAuthProvider provider,
) async {
  if (!isSignedIn || !activeProviderIds.contains(provider.providerId)) {
    throw Exception(
      "You are not logged in with the proper AuthProvider. Please login with the [signIn] method.",
    );
  }
  if (!await adapter.reauth(provider: provider)) {
    throw Exception("Password is incorrect.");
  }
  return this;
}