confirmChange method

Future<Authentication> confirmChange(
  1. ConfirmChangeAuthProvider provider
)

If you change with ChangePhoneNumberAuthProvider, for example, you need to check the authentication code you received from an email or SMS. In that case, use this method to finalize the change.

Confirm sign-in by passing a class inheriting from ConfirmChangeAuthProvider with provider.

If you are not signed in, Exception is returned.

ChangePhoneNumberAuthProviderなどでchangeした場合、メールやSMSから受け取った認証コードをチェックする必要があります。 その場合、このメソッドを利用して変更を確定させてください。

ConfirmChangeAuthProviderを継承したクラスをproviderで渡すことにより、サインインを確定させます。

サインインしていない場合はExceptionが返されます。

Implementation

Future<Authentication> confirmChange(
  ConfirmChangeAuthProvider 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.",
    );
  }
  await adapter.confirmChange(
    provider: provider,
    onUserStateChanged: notifyListeners,
  );
  return this;
}