resetPassword method

Future<void> resetPassword({
  1. required String token,
  2. required String newPassword,
})

Resets password with token

Implementation

Future<void> resetPassword({
  required String token,
  required String newPassword,
}) async {
  final response = await _client.post(
    Uri.parse('$baseUrl/auth/reset-password'),
    headers: {'Content-Type': 'application/json'},
    body: jsonEncode({
      'token': token,
      'password': newPassword,
    }),
  );

  _handleResponse(response);
}