From 7ae777a825ce68e7092ddb0e7790adfd360a3989 Mon Sep 17 00:00:00 2001 From: wjie <382170523@qq.com> Date: Sat, 4 Sep 2021 15:35:20 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=20closed=20#3124=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E8=A1=A8=E5=82=A8=E5=AD=98=EF=BC=8C=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-auth/src/main/resources/templates/ftl/login.ftl | 3 ++- .../listener/AuthenticationLogoutSuccessEventListener.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pigx-auth/src/main/resources/templates/ftl/login.ftl b/pigx-auth/src/main/resources/templates/ftl/login.ftl index 24ec34d4f..0b95aac81 100755 --- a/pigx-auth/src/main/resources/templates/ftl/login.ftl +++ b/pigx-auth/src/main/resources/templates/ftl/login.ftl @@ -17,7 +17,7 @@
- + <#if tenantList??> + diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/listener/AuthenticationLogoutSuccessEventListener.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/listener/AuthenticationLogoutSuccessEventListener.java index 327ad62f6..ab43753d5 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/listener/AuthenticationLogoutSuccessEventListener.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/listener/AuthenticationLogoutSuccessEventListener.java @@ -46,6 +46,11 @@ public class AuthenticationLogoutSuccessEventListener implements ApplicationList */ @Override public void onApplicationEvent(LogoutSuccessEvent event) { + // 健壮性判断 + if (!(event.getSource() instanceof OAuth2Authentication)) { + return; + } + OAuth2Authentication authentication = (OAuth2Authentication) event.getSource(); if (logoutHandler != null && isUserAuthentication(authentication)) { ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder