Commit 9bf4430553f4a0925421538e172552814048af66
Merge remote-tracking branch 'origin/master' into feature_user-session-timeout
Showing
1 changed file
with
1 additions
and
1 deletions
src/main/java/cn/iocoder/dashboard/framework/security/core/util/SecurityFrameworkUtils.java
| ... | ... | @@ -56,7 +56,7 @@ public class SecurityFrameworkUtils { |
| 56 | 56 | if (authentication == null) { |
| 57 | 57 | return null; |
| 58 | 58 | } |
| 59 | - return (LoginUser) authentication.getPrincipal(); | |
| 59 | + return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null; | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** | ... | ... |