fix problems

This commit is contained in:
2026-10-30 11:07:02 +03:00
parent e3a6372e91
commit b94b07654f
7 changed files with 71 additions and 12 deletions
+3 -1
View File
@@ -35,7 +35,9 @@ final class Input {
if (node == null || !node.isTextual()) throw ApiException.invalid("Пароль должен быть строкой");
String value = node.textValue();
int length = value.codePointCount(0, value.length());
if (length < 12 || length > 128) throw ApiException.invalid("Пароль должен содержать от 12 до 128 символов");
if (length < 12 || length > 128 || value.codePoints().allMatch(Input::isUnicodeWhitespace)) {
throw ApiException.invalid("Пароль должен содержать от 12 до 128 непробельных символов");
}
return value;
}