AccessToken过期后没有更新AccountToken的tokenSignList
- Dominant language
- Java
- Stars
- 19k
- Forks
- 2.9k
- PR merge metrics
- No merged PRs in 30d
Description
### 使用版本:
1.38.0
### 报错信息:
没有报错,逻辑问题
### 希望结果:
根据登陆用户查询所有token列表,过期的token不应该显示出来
### 复现步骤:
设置自定义配置的StpUserUtil :
`@PostConstruct
public void setSaTokenConfig() {
log.info("StpUserUtil setSaTokenConfig");
// 设定 StpUserUtil 使用的 SaTokenConfig 配置参数对象
SaTokenConfig config = new SaTokenConfig();
config.setTokenName("Authorization");
config.setTimeout(TimeUnit.HOURS.toSeconds(10));
config.setTimeout(TimeUnit.MINUTES.toSeconds(2));
config.setTokenStyle("simple-uuid");
// 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
config.setIsShare(false);
config.setIsReadCookie(false);
config.setAutoRenew(false);
// 获取TokenSession检测是否登录
config.setTokenSessionCheckLogin(false);
StpUserUtil.stpLogic.setConfig(config);
}`
请求登陆获得到token之后,在token过期之后去调用如下接口,发现还是会存在已经过期的token,如下代码:
`@GetMapping("/test2")
public R test2() {
Long userId = StpUserUtil.getLoginIdAsLong();
List tokenList = StpUserUtil.getTokenValueListByLoginId(userId);
return R.ok(tokenList);
}`
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the StpUserUtil.getTokenValueListByLoginId(userId) call and trace how the account token list and tokenSignList are maintained after token expiry. Reproduce the two-minute timeout scenario from the issue, then verify that expired tokens no longer appear in the returned list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100