Code: Select all
var customUserDto = Optional.ofNullable(getCurrentUserAuthentication()).map(Authentication::getPrincipal)
.filter(CustomUserDetails.class::isInstance).map(CustomUserDetails.class::cast).orElse(null);
< /code>
Ich habe versucht, die gleiche nächste Art und Weise zu tun: < /p>
String username = ReactiveSecurityContextHolder.getContext().map(SecurityContext::getAuthentication)getCurrentUserAuthentication().map(Authentication::getName);
var userInfo = userInfoRepository.findByEmail(username.block()).orElse(null);
Kann es gelöst werden oder ich sollte alle nicht reaktiven Feder wegen db?
danke im Voraus verwenden. < /p>