fetchProviders method

Future<List<String>> fetchProviders(
  1. String email, [
  2. Uri? continueUri
])

Returns a list of all providers that can be used to login.

The given email and continueUri are sent to firebase to figure out which providers can be used. Returns the provider names as in IdpProvider.id or the string "email", if the user can login with the email and a password.

If the request fails, an AuthException will be thrown.

Implementation

Future<List<String>> fetchProviders(
  String email, [
  Uri? continueUri,
]) async {
  final response = await api.fetchProviders(
    FetchProviderRequest(
      identifier: email,
      continueUri: continueUri ?? Uri.http('localhost'),
    ),
  );
  return [
    if (response.registered) 'email',
    ...response.allProviders,
  ];
}