- Notifications
You must be signed in to change notification settings - Fork3k
fix(权限认证): oauth2申请token增加条件判断#313
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
CLAassistant commentedMar 26, 2025
fighter-wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, pleaseadd the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let usrecheck it. |
| .getExpire(redisKey) | ||
| .map(duration ->token.toAccessToken((int) (duration.toMillis() /1000)))) | ||
| .opsForValue() | ||
| .get(userRedisKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
- 通过userTokenManager 更合适?
- user-token: 这个key 表示的是用户的token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
这个key就是用户的token,现在已修改使用userTokenManager判断用户是否登记存在
| .opsForValue() | ||
| .get(userRedisKey) | ||
| .flatMap(token ->userTokenManager | ||
| .userIsLoggedIn(authentication.getUser().getId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
如果用户通过其他方式登录了呢?应该可以直接通过token获取userToken?
| .userIsLoggedIn(authentication.getUser().getId()) | ||
| .flatMap(token ->Mono | ||
| .zip( | ||
| userTokenManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
如果用户通过其他方式登录了,但是access_token已经失效了呢?
| .flatMap(token ->tokenRedis | ||
| .getExpire(redisKey) | ||
| .map(duration ->token.toAccessToken((int) (duration.toMillis() /1000)))) | ||
| .flatMap(token ->userTokenManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
直接filterWhen 就行?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
filterWhen(token-> userTokenManager .tokenIsLoggedIn(token.getAccessToken()) )
| return"oauth2-" +clientId +"-token"; | ||
| } | ||
| privateStringcreateUserTokenRedisKey(Stringkey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
这个方法没用了吧?
9fcdeaf intohs-web:masterUh oh!
There was an error while loading.Please reload this page.
@zhou-hao