Use UsernameNotFoundException Factory
Issue gh-17179
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ public class ReactivePreAuthenticatedAuthenticationManager implements ReactiveAu
|
||||
.filter(this::supports)
|
||||
.map(Authentication::getName)
|
||||
.flatMap(this.userDetailsService::findByUsername)
|
||||
.switchIfEmpty(Mono.error(() -> new UsernameNotFoundException("User not found")))
|
||||
.switchIfEmpty(Mono.error(() -> UsernameNotFoundException.fromUsername(authentication.getName())))
|
||||
.doOnNext(this.userDetailsChecker::check)
|
||||
.map((userDetails) -> {
|
||||
PreAuthenticatedAuthenticationToken result = new PreAuthenticatedAuthenticationToken(userDetails,
|
||||
|
||||
Reference in New Issue
Block a user