فهرست منبع

when extracting the original user, fix by referencing by the interface (UserDetail) rather than the concrete class (User)

Mark St. Godard 20 سال پیش
والد
کامیت
fb3f4af3b2
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java

+ 2 - 2
core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java

@@ -263,8 +263,8 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean,
         UserDetails originalUser = null;
         Object obj = original.getPrincipal();
 
-        if ((obj != null) && obj instanceof User) {
-            originalUser = (User) obj;
+        if ((obj != null) && obj instanceof UserDetails) {
+            originalUser = (UserDetails) obj;
         }
 
         // publish event