mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-16 02:19:14 +08:00
修复无法退出问题
This commit is contained in:
@@ -8,6 +8,7 @@ import org.hswebframework.web.authorization.annotation.QueryAction;
|
||||
import org.hswebframework.web.authorization.annotation.Resource;
|
||||
import org.hswebframework.web.authorization.annotation.SaveAction;
|
||||
import org.hswebframework.web.authorization.exception.UnAuthorizedException;
|
||||
import org.hswebframework.web.authorization.token.ParsedToken;
|
||||
import org.hswebframework.web.authorization.token.TokenState;
|
||||
import org.hswebframework.web.authorization.token.UserToken;
|
||||
import org.hswebframework.web.authorization.token.UserTokenManager;
|
||||
@@ -45,7 +46,7 @@ public class ReactiveUserTokenController {
|
||||
@ApiOperation("重置当前用户的令牌")
|
||||
public Mono<Boolean> resetToken() {
|
||||
return ContextUtils.reactiveContext()
|
||||
.map(context -> context.get(ContextKey.of(UserToken.class)).orElseThrow(UnAuthorizedException::new))
|
||||
.map(context -> context.get(ContextKey.of(ParsedToken.class)).orElseThrow(UnAuthorizedException::new))
|
||||
.flatMap(token -> userTokenManager.signOutByToken(token.getToken()))
|
||||
.thenReturn(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user