Code when Posting to Blog on 22.06.13
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user