fetchSignInMethodsForEmail method

Future<List<String>> fetchSignInMethodsForEmail(
  1. 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.

An empty List is returned if the user could not be found.

A FirebaseAuthException maybe thrown with the following error code:

  • invalid-email
    • Thrown if the email address is not valid.
  • invalid-identifier
    • Thrown if the identifier isn't a valid email

Implementation

Future<List<String>> fetchSignInMethodsForEmail(String email) async {
  try {
    final providers =
        await _api.createAuthUri.fetchSignInMethodsForEmail(email);

    return providers;
  } catch (e) {
    rethrow;
  }
}