oauthProviders method

  1. @override
Future<List<Map<String, Object?>>> oauthProviders({
  1. String? table,
})
override

Implementation

@override
Future<List<Map<String, Object?>>> oauthProviders({String? table}) async {
  final response = await _client.request(
    method: 'GET',
    path: '/auth/oauth/providers',
    query: {'table': table},
  );

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

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

  throw Exception('Invalid response');
}