Browse Source

Polishing.

Use mapNotNull(…) instead of filter + map.

See #3413
pull/3415/head
Mark Paluch 3 weeks ago
parent
commit
3ae9e791ff
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 5
      src/main/antora/modules/ROOT/pages/auditing.adoc

5
src/main/antora/modules/ROOT/pages/auditing.adoc

@ -109,10 +109,9 @@ class SpringSecurityAuditorAware implements ReactiveAuditorAware<User> {
public Mono<User> getCurrentAuditor() { public Mono<User> getCurrentAuditor() {
return ReactiveSecurityContextHolder.getContext() return ReactiveSecurityContextHolder.getContext()
.filter(it -> it.getAuthentication() != null) .mapNotNull(SecurityContext::getAuthentication)
.map(SecurityContext::getAuthentication)
.filter(Authentication::isAuthenticated) .filter(Authentication::isAuthenticated)
.map(Authentication::getPrincipal) .mapNotNull(Authentication::getPrincipal)
.map(User.class::cast); .map(User.class::cast);
} }
} }

Loading…
Cancel
Save