@Override
public boolean supportsParameter(MethodParameter parameter) {
return parameter.hasParameterAnnotation(AuthenticationPrincipal.class);
}
@Override
<BUG>public Mono<Object> resolveArgument(MethodParameter parameter, ModelMap model, ServerWebExchange exchange) {
return repository.load(exchange).then( sc -> {</BUG>
Authentication authentication = sc.getAuthentication();
return authentication == null ? Mono.empty() : Mono.just(authentication.getPrincipal());
});

@Override
public boolean supportsParameter(MethodParameter parameter) {
return parameter.hasParameterAnnotation(AuthenticationPrincipal.class);
}
@Override
public Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext,
ServerWebExchange exchange) {
return repository.load(exchange).then( sc -> {
Authentication authentication = sc.getAuthentication();
return authentication == null ? Mono.empty() : Mono.just(authentication.getPrincipal());
});
