Skip to content

Commit

Permalink
fix: 비밀번호 초기화시 "reset-password"라는 목적인지 검증하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
khee2 committed Jul 23, 2024
1 parent e30155f commit b4734b0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public ResponseEntity<?> refreshAccessToken(@RequestHeader("Authorization") Stri
@PostMapping("/reset-pw")
public ResponseEntity<?> resetPassword(@RequestHeader("X-Reset-Password-Token") String resetToken, @RequestBody @Valid ResetPwRequestDto resetPwRequestDto) {
String token = jwtTokenProvider.resolveToken(resetToken);
if (!jwtTokenProvider.validateTokenByPwConfirm(token, resetToken)) {
if (!jwtTokenProvider.validateTokenByPwConfirm(token, "reset-password")) {
return ResponseEntity.status(401).body(Map.of("error", "unauthorized", "message", "비밀번호를 재설정할 권한이 없습니다"));
}
if (!resetPwRequestDto.getNewPassword().equals(resetPwRequestDto.getNewPasswordConfirm())) {
Expand Down

0 comments on commit b4734b0

Please sign in to comment.