Browse Source

Polishing.

Use mapNotNull(…) instead of filter + map.

See #3413
3.5.x
Mark Paluch 3 weeks ago
parent
commit
1ad4d057b0
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

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

Loading…
Cancel
Save