resetPassword method

Future<StatusResponse> resetPassword({
  1. required String otp,
  2. required String phoneNumber,
  3. required String newPassword,
})

Reset the password of the user

otp The OTP to reset the password

phoneNumber The phone number to reset the password

newPassword The new password to set

Implementation

Future<StatusResponse> resetPassword({
  required String otp,
  required String phoneNumber,
  required String newPassword,
}) async {
  try {
    final response = await dio.post(
      "/phone-number/reset-password",
      data: {"otp": otp, "phoneNumber": phoneNumber, "newPassword": newPassword},
    );
    return StatusResponse.fromJson(response.data);
  } catch (e) {
    final message = getErrorMessage(e);
    if (message == null) rethrow;
    throw message;
  }
}