fetchSignInMethodsForEmail method

Future<List<String>?> fetchSignInMethodsForEmail({
  1. required String email,
})

Returns a list of sign-in methods that can be used to sign in a given user (identified by its main email address).

This method is useful when you support multiple authentication mechanisms if you want to implement an email-first authentication flow.

Errors: • ERROR_INVALID_CREDENTIAL - If the email address is malformed. • ERROR_USER_NOT_FOUND - If there is no user corresponding to the given email address.

Implementation

Future<List<String>?> fetchSignInMethodsForEmail({
  required String email,
}) async {
  List<String>? providers;

  try {
    providers = await _modAuth?.fetchSignInMethodsForEmail(email);
  } catch (ex) {
    setError(ex);
    providers = null;
  }
  return providers;
}