mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
parent
27fdc3ef02
commit
eccff8d2b0
|
@ -39,6 +39,9 @@ public class UserController {
|
||||||
if (result.hasErrors()){
|
if (result.hasErrors()){
|
||||||
return "register";
|
return "register";
|
||||||
}
|
}
|
||||||
|
if (form.getPassword().chars().anyMatch(Character::isISOControl)) {
|
||||||
|
return "register";
|
||||||
|
}
|
||||||
userManagement.createCustomer(form.getUsername(),form.getAddress(),form.getPassword(),form.getFullName());
|
userManagement.createCustomer(form.getUsername(),form.getAddress(),form.getPassword(),form.getFullName());
|
||||||
return "redirect:/login";
|
return "redirect:/login";
|
||||||
}
|
}
|
||||||
|
@ -68,7 +71,9 @@ public class UserController {
|
||||||
user.setFullName(form.getFullName());
|
user.setFullName(form.getFullName());
|
||||||
user.setAddress(form.getAddress());
|
user.setAddress(form.getAddress());
|
||||||
if (!form.getPassword().get().isEmpty()) {
|
if (!form.getPassword().get().isEmpty()) {
|
||||||
userManagement.setPassword(form.getPassword().get(), user.getUserAccount());
|
if (form.getPassword().get().chars().anyMatch(Character::isISOControl)) {
|
||||||
|
userManagement.setPassword(form.getPassword().get(), user.getUserAccount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
userManagement.save(user);
|
userManagement.save(user);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue