up
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user