Commit f8beffc9 authored by maqing's avatar maqing

会话不失效

parent 129ed8d3
...@@ -37,8 +37,6 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author ...@@ -37,8 +37,6 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
private final RedisTemplate redisTemplate; private final RedisTemplate redisTemplate;
private RedisCache redisCache;
@Autowired @Autowired
public AuthorizationManager(RedisTemplate redisTemplate) { public AuthorizationManager(RedisTemplate redisTemplate) {
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
...@@ -67,10 +65,11 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author ...@@ -67,10 +65,11 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
log.info("请求token为空拒绝访问,path={}", path); log.info("请求token为空拒绝访问,path={}", path);
return Mono.just(new AuthorizationDecision(false)); return Mono.just(new AuthorizationDecision(false));
} }
String claims = JwtHelper.decode(token).getClaims(); String subToken = token.substring(AuthConstants.JWT_PREFIX.length());
String claims = JwtHelper.decode(subToken).getClaims();
String jti = (String) JSONObject.parseObject(claims).get("jti"); String jti = (String) JSONObject.parseObject(claims).get("jti");
String acc_token = (String) redisTemplate.opsForValue().get(jti); String acc_token = (String) redisTemplate.opsForValue().get(jti);
if (StrUtil.isBlank(acc_token)) { if (!StrUtil.isBlank(acc_token)) {
log.info("请求token为空拒绝访问,path={}", path); log.info("请求token为空拒绝访问,path={}", path);
return Mono.just(new AuthorizationDecision(false)); return Mono.just(new AuthorizationDecision(false));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment