requirePasswordReset method

  1. @override
Future<Map<String, Object?>> requirePasswordReset({
  1. required String email,
  2. required String table,
  3. String? reason,
  4. String? authorization,
})
override

Implementation

@override
Future<Map<String, Object?>> requirePasswordReset({
  required String email,
  required String table,
  String? reason,
  String? authorization,
}) async {
  final response = await _client.request(
    method: 'POST',
    path: '/admin/members/${email}/require-password-reset',
    headers: {'authorization': authorization},
    query: {'table': table, 'reason': reason},
  );

  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');
}