|
|
@@ -38,6 +38,16 @@ public class JwtAuthFilter extends OncePerRequestFilter {
|
|
|
this.authProperties = authProperties;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 异步分发(如 SSE 流式完成后 Tomcat 的 AsyncContext dispatch)也需要重新设置
|
|
|
+ * SecurityContext,否则 AuthorizationFilter 会因找不到认证信息而抛出
|
|
|
+ * AccessDeniedException。
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ protected boolean shouldNotFilterAsyncDispatch() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected void doFilterInternal(HttpServletRequest request,
|
|
|
@NotNull HttpServletResponse response,
|