fetchProviders method
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 AuthError
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,
];
}