when extracting the original user, fix by referencing by the interface (UserDetail) rather than the concrete class (User)
This commit is contained in:
parent
24394b7b2b
commit
fb3f4af3b2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue