diff --git a/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersRepository.java b/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersRepository.java index 90f675fe..d0a8af25 100644 --- a/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersRepository.java +++ b/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersRepository.java @@ -6,7 +6,7 @@ import reactor.core.publisher.Mono; /** - * @author Alex bob(https://github.com/vnobo) + * @author AlexBob */ public interface UsersRepository extends R2dbcRepository { /** diff --git a/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersService.java b/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersService.java index 3cc9bab5..d9b12cfc 100644 --- a/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersService.java +++ b/boot/platform/src/main/java/com/platform/boot/security/core/user/UsersService.java @@ -54,7 +54,7 @@ public Mono loadByCode(String code) { public Mono add(UserRequest request) { return this.usersRepository.existsByUsernameIgnoreCase(request.getUsername()).flatMap(exists -> { if (exists) { - return Mono.error(RestServerException.withMsg(1101, "User already exists", + return Mono.error(RestServerException.withMsg(417, "User already exists", "Username [" + request.getUsername() + "] already exists!")); } return this.operate(request); @@ -110,7 +110,6 @@ public Mono save(User user) { private String upgradeEncodingIfPassword(String password) { if (StringUtils.hasLength(password) && this.passwordEncoder.upgradeEncoding(password)) { - // Encode the password return this.passwordEncoder.encode(password); } return password; diff --git a/boot/platform/src/main/java/com/platform/boot/security/filter/CaptchaFilter.java b/boot/platform/src/main/java/com/platform/boot/security/filter/CaptchaFilter.java index 970ee892..b24f9d00 100644 --- a/boot/platform/src/main/java/com/platform/boot/security/filter/CaptchaFilter.java +++ b/boot/platform/src/main/java/com/platform/boot/security/filter/CaptchaFilter.java @@ -44,8 +44,7 @@ public CaptchaFilter(CaptchaRepository captchaTokenRepository) { } @Override - @NonNull - public Mono filter(@NonNull ServerWebExchange exchange, @NonNull WebFilterChain chain) { + public @NonNull Mono filter(@NonNull ServerWebExchange exchange, @NonNull WebFilterChain chain) { return REQUIRE_CAPTCHA_PROTECTION_MATCHER.matches(exchange) .filter(ServerWebExchangeMatcher.MatchResult::isMatch) .switchIfEmpty(Mono.defer(() -> continueFilterChain(exchange, chain).then(Mono.empty())))