Class ForgotPasswordController
java.lang.Object
callofproject.dev.authentication.controller.ForgotPasswordController
@RequestMapping("api/auth/forgot-password")
@RestController
public class ForgotPasswordController
extends Object
Authentication Controller
Copyleft (C), 2023, Cal-of-Project-Teams Developers.
All Rights free.
-
Constructor Summary
ConstructorsConstructorDescriptionForgotPasswordController
(ForgotPasswordService forgotPasswordService) Constructor for the AuthenticationController class. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
changePassword
(ForgotPasswordDTO forgotPasswordDTO) Change user password after confirmorg.springframework.http.ResponseEntity<Object>
SendPasswordResetEmail
(String email) Send password reset email with generated token.
-
Constructor Details
-
ForgotPasswordController
Constructor for the AuthenticationController class. It is used to inject dependencies into the controller.- Parameters:
forgotPasswordService
- The AuthenticationService object to be injected.
-
-
Method Details
-
SendPasswordResetEmail
@PostMapping("/password-reset-request") public org.springframework.http.ResponseEntity<Object> SendPasswordResetEmail(@RequestParam("email") String email) Send password reset email with generated token.- Parameters:
email
- represent the email- Returns:
- the boolean value.
-
changePassword
@PostMapping("/password-reset") public org.springframework.http.ResponseEntity<Object> changePassword(@RequestBody ForgotPasswordDTO forgotPasswordDTO) Change user password after confirm- Parameters:
forgotPasswordDTO
- represent the information of new password and token- Returns:
- boolean value.
-