From fab8c254c65679906b9df41a1266e6bbf09df7a4 Mon Sep 17 00:00:00 2001 From: KhaiNguyenDuc Date: Thu, 16 May 2024 17:26:36 +0700 Subject: [PATCH] Fix minor bug --- .../khai/quizguru/controller/AuthController.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/back-end/src/main/java/com/khai/quizguru/controller/AuthController.java b/back-end/src/main/java/com/khai/quizguru/controller/AuthController.java index e560445..61ef8c8 100644 --- a/back-end/src/main/java/com/khai/quizguru/controller/AuthController.java +++ b/back-end/src/main/java/com/khai/quizguru/controller/AuthController.java @@ -148,14 +148,14 @@ public ResponseEntity 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 sendResetPasssword( - @Valid @RequestBody String email) { + public ResponseEntity 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); } @@ -165,14 +165,10 @@ public ResponseEntity sendResetPasssword( * @return JsonResponse: a json contain message success. */ @PostMapping("/reset-password") - public ResponseEntity resetPasssword( + public ResponseEntity resetPassword( @Valid @RequestBody PasswordResetRequest request) { userService.resetPassword(request); return new ResponseEntity<>(new JsonResponse("success", "success"),HttpStatus.OK); } - - - - }