resetPassword method

Future<SuccessResponse> resetPassword({
  1. required String email,
  2. required String otp,
  3. required String password,
})

Reset password using email OTP

email The email address of the user

otp The OTP sent to the user's email

password The new password of the user

Implementation

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