From c6cb4025c674ed12a6ed1a1b5520fd0c10d86aa5 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Sat, 25 Jun 2022 22:01:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=9A=E8=BF=87key=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=90=8E=E6=B8=85=E7=90=86session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/security/ApiKeyFilter.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java b/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java index c510f4aab7..21f40871ec 100644 --- a/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java +++ b/backend/src/main/java/io/metersphere/security/ApiKeyFilter.java @@ -49,4 +49,11 @@ public class ApiKeyFilter extends AnonymousFilter { return true; } + + @Override + protected void postHandle(ServletRequest request, ServletResponse response) throws Exception { + if (SecurityUtils.getSubject().isAuthenticated()) { + SecurityUtils.getSubject().logout(); + } + } }