From 31b595bd15a9d70803ba3e5d552bd67e0156ec4f Mon Sep 17 00:00:00 2001 From: DaeYoung Park Date: Fri, 2 Aug 2024 11:59:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20HTTp=20Status=20Code=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/gible/domain/security/jwt/JwtExceptionFilter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/gible/domain/security/jwt/JwtExceptionFilter.java b/src/main/java/gible/domain/security/jwt/JwtExceptionFilter.java index 7893fe7..269976d 100644 --- a/src/main/java/gible/domain/security/jwt/JwtExceptionFilter.java +++ b/src/main/java/gible/domain/security/jwt/JwtExceptionFilter.java @@ -30,10 +30,12 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse } catch (ExpiredJwtException e){ log.info("expiredJwtEcxeption"); ErrorType errorType = ErrorType.TOKEN_EXPIRED; + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.getWriter().write(objectMapper.writeValueAsString(ErrorRes.of(errorType.getStatus(), errorType.getMessage()))); } catch (JwtException e){ log.info("JwtException"); ErrorType errorType = ErrorType.TOKEN_NOT_FOUND; + response.setStatus(HttpServletResponse.SC_NOT_FOUND); response.getWriter().write(objectMapper.writeValueAsString(ErrorRes.of(errorType.getStatus(), errorType.getMessage()))); } }