Class ForgotPasswordService

java.lang.Object
callofproject.dev.authentication.service.ForgotPasswordService

@Service @Lazy public class ForgotPasswordService extends Object
Service class for handling forgot password operations.
  • Constructor Details

    • ForgotPasswordService

      public ForgotPasswordService(callofproject.dev.repository.authentication.dal.UserServiceHelper userServiceHelper, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, KafkaProducer kafkaProducer)
      Constructor for ForgotPasswordService.
      Parameters:
      userServiceHelper - The UserServiceHelper to interact with user-related operations.
      passwordEncoder - The PasswordEncoder for encoding passwords.
      kafkaProducer - The KafkaProducer for sending email notifications.
  • Method Details

    • sendResetPasswordLink

      public callofproject.dev.data.common.clas.ResponseMessage<Object> sendResetPasswordLink(String email)
      Sends a reset password link to the user's email.
      Parameters:
      email - The user's email address.
      Returns:
      A ResponseMessage indicating the result of sending the reset password link.
    • resetPassword

      public callofproject.dev.data.common.clas.ResponseMessage<Object> resetPassword(ForgotPasswordDTO forgotPasswordDTO)
      Resets the user's password based on the provided ForgotPasswordDTO.
      Parameters:
      forgotPasswordDTO - The DTO containing the necessary information for password reset.
      Returns:
      A ResponseMessage indicating the result of the password reset.