Code when Posting to Blog on 22.06.13

This commit is contained in:
hou27
2022-06-13 19:10:32 +09:00
parent 02228ed615
commit fc26a2a1cc
2 changed files with 2 additions and 5 deletions

View File

@@ -30,9 +30,9 @@ public class JwtTokenFilter extends OncePerRequestFilter {
Authentication auth = jwtTokenProvider.getAuthentication(token);
SecurityContextHolder.getContext().setAuthentication(auth); // 정상 토큰이면 SecurityContext에 저장
}
} catch (CustomException ex) {
} catch (CustomException e) {
SecurityContextHolder.clearContext();
response.sendError(ex.getHttpStatus().value(), ex.getMessage());
response.sendError(e.getHttpStatus().value(), e.getMessage());
return;
}

View File

@@ -6,9 +6,6 @@ import java.util.List;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
@Slf4j