Skip to content

Commit

Permalink
ExceptionHandler JWT 관련 예외 누락 수정 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Jul 31, 2024
1 parent 4fba4f8 commit ab5b52a
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import com.stempo.api.global.exception.NotFoundException;
import com.stempo.api.global.exception.PermissionDeniedException;
import com.stempo.api.global.exception.SortingArgumentException;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.MalformedJwtException;
import io.jsonwebtoken.UnsupportedJwtException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.ConstraintViolationException;
Expand Down Expand Up @@ -53,7 +56,8 @@ public class GlobalExceptionHandler {
NumberFormatException.class,
UnknownPathException.class,
InvalidColumnException.class,
SortingArgumentException.class
SortingArgumentException.class,
IllegalArgumentException.class
})
public ErrorResponse<Exception> badRequestException(HttpServletResponse response, Exception e) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
Expand All @@ -66,7 +70,11 @@ public ErrorResponse<Exception> badRequestException(HttpServletResponse response
BadCredentialsException.class,
TokenValidateException.class,
TokenNotFoundException.class,
TokenForgeryException.class
TokenForgeryException.class,
io.jsonwebtoken.security.SecurityException.class,
MalformedJwtException.class,
ExpiredJwtException.class,
UnsupportedJwtException.class,
})
public ApiResponse<Void> unAuthorizeException(HttpServletResponse response, Exception e) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
Expand Down

0 comments on commit ab5b52a

Please sign in to comment.