From 0fdd62fade6ca326a7322b6213f4454f542388bc Mon Sep 17 00:00:00 2001 From: Donghun Won Date: Sun, 22 Sep 2024 18:14:46 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20=ED=86=A0=ED=81=B0=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=88=98=EC=A0=95=20(#193)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solitour/gathering/controller/GatheringController.java | 3 ++- .../solitour/information/controller/InformationController.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/solitour_backend/solitour/gathering/controller/GatheringController.java b/src/main/java/solitour_backend/solitour/gathering/controller/GatheringController.java index 73ffeee..d6472d9 100644 --- a/src/main/java/solitour_backend/solitour/gathering/controller/GatheringController.java +++ b/src/main/java/solitour_backend/solitour/gathering/controller/GatheringController.java @@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import solitour_backend.solitour.auth.config.AuthenticationPrincipal; +import solitour_backend.solitour.auth.exception.TokenNotExistsException; import solitour_backend.solitour.auth.exception.TokenNotValidException; import solitour_backend.solitour.auth.support.CookieExtractor; import solitour_backend.solitour.auth.support.JwtTokenProvider; @@ -212,7 +213,7 @@ private Long findUser(HttpServletRequest request) { } if (jwtTokenProvider.validateTokenNotUsable(token)) { - throw new TokenNotValidException("토큰이 유효하지 않습니다."); + throw new TokenNotExistsException("토큰이 존재하지 않습니다."); } return jwtTokenProvider.getPayload(token); diff --git a/src/main/java/solitour_backend/solitour/information/controller/InformationController.java b/src/main/java/solitour_backend/solitour/information/controller/InformationController.java index e188c9e..fda6368 100644 --- a/src/main/java/solitour_backend/solitour/information/controller/InformationController.java +++ b/src/main/java/solitour_backend/solitour/information/controller/InformationController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import solitour_backend.solitour.auth.config.Authenticated; import solitour_backend.solitour.auth.config.AuthenticationPrincipal; +import solitour_backend.solitour.auth.exception.TokenNotExistsException; import solitour_backend.solitour.auth.exception.TokenNotValidException; import solitour_backend.solitour.auth.support.CookieExtractor; import solitour_backend.solitour.auth.support.JwtTokenProvider; @@ -165,7 +166,7 @@ private Long findUser(HttpServletRequest request) { } if (jwtTokenProvider.validateTokenNotUsable(token)) { - throw new TokenNotValidException("토큰이 유효하지 않습니다."); + throw new TokenNotExistsException("토큰이 존재하지 않습니다."); } return jwtTokenProvider.getPayload(token);