refactor: 增加NoStackTrace异常,特定情况不记录线程栈.

This commit is contained in:
zhouhao
2024-04-29 13:36:33 +08:00
parent cb4cbee8cb
commit 775f8f161c
17 changed files with 190 additions and 28 deletions

View File

@@ -131,12 +131,12 @@ public class AuthorizationController {
} else {
authenticationMono = ReactiveAuthenticationHolder
.get(event.getUserId())
.switchIfEmpty(Mono.error(() -> new AuthenticationException(AuthenticationException.USER_DISABLED)));
.switchIfEmpty(Mono.error(() -> new AuthenticationException.NoStackTrace(AuthenticationException.USER_DISABLED)));
}
} else {
authenticationMono = authenticationManager
.authenticate(Mono.just(new PlainTextUsernamePasswordAuthenticationRequest(event.getUsername(), event.getPassword())))
.switchIfEmpty(Mono.error(() -> new AuthenticationException(AuthenticationException.ILLEGAL_PASSWORD)));
.switchIfEmpty(Mono.error(() -> new AuthenticationException.NoStackTrace(AuthenticationException.ILLEGAL_PASSWORD)));
}
return authenticationMono;
}