Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚑hotfix:비밀번호 재설정 오류 수정 #59

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@NoArgsConstructor
public class VerificationCodeConfirmDTO {
@NotNull

private String code;
private String newPassword;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ public ResponseEntity<?> resetPassword(@RequestBody @Valid VerificationCodeReque

//* 비밀번호 재설정 확인
@PostMapping("/confirm-reset-password")
public ResponseEntity<?> confirmResetPassword(@RequestParam("code") String code, @RequestBody @Valid VerificationCodeConfirmDTO confirmDTO) {
String result = signupService.validatePasswordResetCode(code);
public ResponseEntity<?> confirmResetPassword(@RequestBody @Valid VerificationCodeConfirmDTO confirmDTO) {
String result = signupService.validatePasswordResetCode(confirmDTO.getCode());
if (!result.equals("valid")) {
return ResponseEntity.badRequest().body(ErrorCode.PASSWORD_RESET_INVALID.getMessage());
}
try {
// 비밀번호 재설정
signupService.resetPassword(code, confirmDTO.getNewPassword());
signupService.resetPassword(confirmDTO.getCode(), confirmDTO.getNewPassword());
return ResponseEntity.ok(SuccessCode.SUCCESS_PASSWORD_RESET.getMessage());
} catch (CustomException e) {
return ResponseEntity.badRequest().body(ErrorCode.PASSWORD_RESET_INVALID.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public String validatePasswordResetCode(String code) {
throw new CustomException(ErrorCode.PASSWORD_RESET_INVALID);
}

return SuccessCode.SUCCESS_PASSWORD_RESET.getMessage();
return "valid";
}

@Override
Expand Down
Loading