listAuthMethods method

Future<AuthMethodsList> listAuthMethods({
  1. String? fields,
  2. Map<String, dynamic> query = const {},
  3. Map<String, String> headers = const {},
})

Returns all available application auth methods.

Implementation

Future<AuthMethodsList> listAuthMethods({
  String? fields,
  Map<String, dynamic> query = const {},
  Map<String, String> headers = const {},
}) {
  // @todo remove after deleting the pre v0.23 API response fields
  final enrichedQuery = Map<String, dynamic>.of(query);
  enrichedQuery["fields"] ??= "mfa,otp,password,oauth2";

  return client
      .send<Map<String, dynamic>>(
        "$baseCollectionPath/auth-methods",
        query: enrichedQuery,
        headers: headers,
      )
      .then(AuthMethodsList.fromJson);
}