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);