validateCredentials method

Future<bool> validateCredentials(
  1. String strategy,
  2. String id,
  3. Map<String, dynamic> credentials
)

Checks if the provided credentials are well-formed. Does not actually save credentials.

Implementation

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

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

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