Skip to content

Commit

Permalink
Fix minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaiNguyenDuc committed May 16, 2024
1 parent b770d00 commit fab8c25
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ public ResponseEntity<TokenRefreshResponse> refreshToken(@Valid @RequestBody Tok

/**
* Send reset password email contain reset password token to user's email
* @param email: includes user's username/email
* @param loginRequest: includes user's username/email
* @return JsonResponse: json response contain userId for specific client usage
*/
@PostMapping("/send-reset-password")
public ResponseEntity<JsonResponse> sendResetPasssword(
@Valid @RequestBody String email) {
public ResponseEntity<JsonResponse> sendResetPassword(
@Valid @RequestBody LoginRequest loginRequest) {

String userId = userService.sendResetPassword(email);
String userId = userService.sendResetPassword(loginRequest.getEmail());
return new ResponseEntity<>(new JsonResponse("success", userId),HttpStatus.OK);
}

Expand All @@ -165,14 +165,10 @@ public ResponseEntity<JsonResponse> sendResetPasssword(
* @return JsonResponse: a json contain message success.
*/
@PostMapping("/reset-password")
public ResponseEntity<JsonResponse> resetPasssword(
public ResponseEntity<JsonResponse> resetPassword(
@Valid @RequestBody PasswordResetRequest request) {

userService.resetPassword(request);
return new ResponseEntity<>(new JsonResponse("success", "success"),HttpStatus.OK);
}




}

0 comments on commit fab8c25

Please sign in to comment.