diff --git a/src/main/java/com/moim/backend/global/auth/LoginInterceptor.java b/src/main/java/com/moim/backend/global/auth/LoginInterceptor.java index c6cf54a..26ae6b5 100644 --- a/src/main/java/com/moim/backend/global/auth/LoginInterceptor.java +++ b/src/main/java/com/moim/backend/global/auth/LoginInterceptor.java @@ -1,6 +1,9 @@ package com.moim.backend.global.auth; import com.moim.backend.global.auth.jwt.JwtService; +import com.moim.backend.global.common.Result; +import com.moim.backend.global.common.exception.CustomException; +import io.jsonwebtoken.ExpiredJwtException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; @@ -27,12 +30,8 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons String authorization = request.getHeader(AUTHORIZATION); if (authorization != null) { - try { - String token = jwtService.getToken(Optional.of(authorization)); - jwtService.validateToken(token); - } catch (Exception e) { - return false; - } + String token = jwtService.getToken(Optional.of(authorization)); + jwtService.validateToken(token); } return true;