瀏覽代碼

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