adminAuthenticate method

  1. @override
Future<Map<String, Object?>?> adminAuthenticate({
  1. required AdminAuthBody body,
})
override

Implementation

@override
Future<Map<String, Object?>?> adminAuthenticate({
  required AdminAuthBody body,
}) async {
  final response = await _client.request(
    method: 'POST',
    path: '/auth/admin',
    body: body,
  );

  final _body = await response.transform(utf8.decoder).join();

  if (jsonDecode(_body) case {'data': final Map? data}) {
    return data?.map((key, value) => MapEntry((key as String), value));
  }

  throw Exception('Invalid response');
}