|
16 | 16 | import org.springframework.web.bind.annotation.RestController; |
17 | 17 | import com.digitalsanctuary.spring.user.audit.AuditEvent; |
18 | 18 | import com.digitalsanctuary.spring.user.dto.PasswordDto; |
| 19 | +import com.digitalsanctuary.spring.user.dto.PasswordResetRequestDto; |
19 | 20 | import com.digitalsanctuary.spring.user.dto.UserDto; |
20 | 21 | import com.digitalsanctuary.spring.user.event.OnRegistrationCompleteEvent; |
21 | 22 | import com.digitalsanctuary.spring.user.exceptions.InvalidOldPasswordException; |
@@ -133,13 +134,13 @@ public ResponseEntity<JSONResponse> updateUserAccount(@AuthenticationPrincipal D |
133 | 134 | * This is used when the user has forgotten their password and wants to reset their password. This will send an email to the user with a link to |
134 | 135 | * reset their password. |
135 | 136 | * |
136 | | - * @param userDto the user data transfer object containing user details |
| 137 | + * @param passwordResetRequest the password reset request containing the email address |
137 | 138 | * @param request the HTTP servlet request |
138 | 139 | * @return a ResponseEntity containing a JSONResponse with the password reset email send result |
139 | 140 | */ |
140 | 141 | @PostMapping("/resetPassword") |
141 | | - public ResponseEntity<JSONResponse> resetPassword(@Valid @RequestBody UserDto userDto, HttpServletRequest request) { |
142 | | - User user = userService.findUserByEmail(userDto.getEmail()); |
| 142 | + public ResponseEntity<JSONResponse> resetPassword(@Valid @RequestBody PasswordResetRequestDto passwordResetRequest, HttpServletRequest request) { |
| 143 | + User user = userService.findUserByEmail(passwordResetRequest.getEmail()); |
143 | 144 | if (user != null) { |
144 | 145 | userEmailService.sendForgotPasswordVerificationEmail(user, UserUtils.getAppUrl(request)); |
145 | 146 | logAuditEvent("Reset Password", "Success", "Password reset email sent", user, request); |
|
0 commit comments