mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 08:54:07 +08:00
优化token获取
This commit is contained in:
@@ -47,8 +47,8 @@ public class ReactiveUserTokenController {
|
||||
@Authorize(merge = false)
|
||||
@Operation(summary = "重置当前用户的令牌")
|
||||
public Mono<Boolean> resetToken() {
|
||||
return ContextUtils.reactiveContext()
|
||||
.map(context -> context.get(ContextKey.of(ParsedToken.class)).orElseThrow(UnAuthorizedException::new))
|
||||
return Mono
|
||||
.<ParsedToken>deferWithContext(ctx -> Mono.justOrEmpty(ctx.getOrEmpty(ParsedToken.class)))
|
||||
.flatMap(token -> userTokenManager.signOutByToken(token.getToken()))
|
||||
.thenReturn(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user