mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-06 21:30:18 +08:00
Merge pull request #183 from JiaRG/upstream-3.0.x
解决集成Redisson时ValueWrapper变为NullValue导致认证失败的问题 fix #182
This commit is contained in:
@@ -6,7 +6,6 @@ import org.hswebframework.web.authorization.Authentication;
|
||||
import org.hswebframework.web.authorization.AuthenticationInitializeService;
|
||||
import org.hswebframework.web.authorization.AuthenticationManager;
|
||||
import org.hswebframework.web.authorization.AuthenticationRequest;
|
||||
import org.hswebframework.web.authorization.listener.event.AuthorizationFailedEvent;
|
||||
import org.hswebframework.web.authorization.simple.PlainTextUsernamePasswordAuthenticationRequest;
|
||||
import org.hswebframework.web.commons.entity.DataStatus;
|
||||
import org.hswebframework.web.entity.authorization.UserEntity;
|
||||
@@ -16,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -98,7 +96,7 @@ public class SimpleAuthenticationManager implements AuthenticationManager {
|
||||
if (null != cacheManager) {
|
||||
Cache cache = cacheManager.getCache(USER_AUTH_CACHE_NAME);
|
||||
Cache.ValueWrapper wrapper = cache.get(userId);
|
||||
if (wrapper == null) {
|
||||
if (wrapper == null || wrapper.get() == null) {
|
||||
Authentication authentication = supplier.get();
|
||||
cache.put(userId, authentication);
|
||||
return authentication;
|
||||
|
||||
Reference in New Issue
Block a user