hasCredentials method

Future<bool> hasCredentials(
  1. String strategy,
  2. String id
)

Checks if a user has credentials registered for the specified authentication strategy.

Implementation

Future<bool> hasCredentials(String strategy, String id) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'hasCredentials',
    strategy: strategy,
    uid: id,
  ));

  if (response.result is bool) {
    return response.result as bool;
  }

  throw BadResponseFormatError(response.error?.id,
      '$name.hasCredentials: bad response format', response);
}