Commit 4f5ebb797a2b9bda24bb057f6e7e4c2dfaeb4ad6
Committed by
Gitee
!10 修复 匿名用户会被鉴定为anonymousUser
Merge pull request !10 from niu_dehua/fix_login
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 | /** | ... | ... |