Skip to content

Commit 3cfb1d6

Browse files
authored
Merge pull request hs-web#183 from JiaRG/upstream-3.0.x
解决集成Redisson时ValueWrapper变为NullValue导致认证失败的问题 fix hs-web#182
2 parents 76258ea + abb401c commit 3cfb1d6

File tree

1 file changed

+1
-3
lines changed
  • hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple

1 file changed

+1
-3
lines changed

hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthenticationManager.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.hswebframework.web.authorization.AuthenticationInitializeService;
77
import org.hswebframework.web.authorization.AuthenticationManager;
88
import org.hswebframework.web.authorization.AuthenticationRequest;
9-
import org.hswebframework.web.authorization.listener.event.AuthorizationFailedEvent;
109
import org.hswebframework.web.authorization.simple.PlainTextUsernamePasswordAuthenticationRequest;
1110
import org.hswebframework.web.commons.entity.DataStatus;
1211
import org.hswebframework.web.entity.authorization.UserEntity;
@@ -16,7 +15,6 @@
1615
import org.springframework.cache.Cache;
1716
import org.springframework.cache.CacheManager;
1817
import org.springframework.cache.annotation.CachePut;
19-
import org.springframework.cache.annotation.Cacheable;
2018

2119
import java.util.function.Supplier;
2220

@@ -98,7 +96,7 @@ public Authentication getByUserId(String userId) {
9896
if (null != cacheManager) {
9997
Cache cache = cacheManager.getCache(USER_AUTH_CACHE_NAME);
10098
Cache.ValueWrapper wrapper = cache.get(userId);
101-
if (wrapper == null) {
99+
if (wrapper == null || wrapper.get() == null) {
102100
Authentication authentication = supplier.get();
103101
cache.put(userId, authentication);
104102
return authentication;

0 commit comments

Comments
 (0)