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