Skip to content

Commit 23e3da2

Browse files
committed
优化
1 parent 1a6108d commit 23e3da2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/UserTokenReactiveAuthenticationSupplier.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,14 @@ public Mono<Authentication> get() {
7373
.<ParsedToken>getOrEmpty(ParsedToken.class)
7474
.map(t -> userTokenManager
7575
.getByToken(t.getToken())
76-
.filter(UserToken::validate)
7776
.flatMap(token -> {
77+
//已过期则返回空
78+
if (token.isExpired()) {
79+
return Mono.empty();
80+
}
81+
if(!token.validate()){
82+
return Mono.empty();
83+
}
7884
Mono<Void> before = userTokenManager.touch(token.getToken());
7985
if (token instanceof AuthenticationUserToken) {
8086
return before.thenReturn(((AuthenticationUserToken) token).getAuthentication());

0 commit comments

Comments
 (0)