This commit is contained in:
2026-04-18 12:20:44 +03:00
parent af757ff224
commit 2068154656
13 changed files with 423 additions and 92 deletions

View File

@@ -37,6 +37,11 @@ public class SetupHandler {
String login = body.getString("login");
String password = body.getString("password");
String email = body.getString("email");
if (email == null || email.isBlank()) {
email = login + "@admin.local"; // значение по умолчанию
}
if (login == null || password == null || login.length() < 3 || password.length() < 6) {
ctx.response().setStatusCode(400)
@@ -47,7 +52,7 @@ public class SetupHandler {
}
String ip = ctx.request().remoteAddress().host();
userService.createUser(login, password, ip).onComplete(cr -> {
userService.createUser(login, email, password, ip, true).onComplete(cr -> {
if (cr.succeeded()) {
ctx.response().setStatusCode(201)
.end(new JsonObject().put("success", true).encode());