Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修正用户是否授权及token是否登记的判断条件 #278

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

goten7
Copy link
Contributor

@goten7 goten7 commented Mar 22, 2024

No description provided.

}

@Override
public Mono<Boolean> tokenIsLoggedIn(String token) {
return operations.hasKey(getTokenRedisKey(token));
return getByToken(token)
.map(t -> !t.isExpired())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么不使用 isNormal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参照了DefaultUserTokenManager里面的判断,方法注释是token是否已登记,所以理解为虽然token无效但是也是平台登记了的?但是方法名又有点歧义,需要改为 isNormal 吗
image

Copy link
Member

@zhou-hao zhou-hao Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按理说应该使用normal。

@zhou-hao zhou-hao merged commit 68fa633 into hs-web:master Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants