listPasskeys method

Future<PasskeyList> listPasskeys({
  1. List<String>? queries,
  2. bool? total,
})

Get the list of verified passkeys registered by the currently logged in user.

Implementation

Future<models.PasskeyList> listPasskeys({
  List<String>? queries,
  bool? total,
}) async {
  final String apiPath = '/account/passkeys';

  final Map<String, dynamic> apiParams = {
    if (queries != null) 'queries': queries,
    if (total != null) 'total': total,
  };

  final Map<String, String> apiHeaders = {
    'X-Appwrite-Project': client.config['project'] ?? '',
    'accept': 'application/json',
  };

  final res = await client.call(
    HttpMethod.get,
    path: apiPath,
    params: apiParams,
    headers: apiHeaders,
  );

  return models.PasskeyList.fromMap(res.data);
}