我使用ServerSecurityContextRepository加载方法实现身份验证,如果令牌错误,它将调用两次,如果正确的令牌正常工作,那么有人知道吗?
return Mono.justOrEmpty(serverWebExchange)
.then(authenticationConverter.convert(serverWebExchange))
.flatMap(this::authenticateToken)
.map(authentication -> {
addHeader(serverWebExchange, (CustomerUser) authentication.getPrincipal());
return new SecurityContextImpl(authentication);
});