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()){
|
||||
return "register";
|
||||
}
|
||||
if (form.getPassword().chars().anyMatch(Character::isISOControl)) {
|
||||
return "register";
|
||||
}
|
||||
userManagement.createCustomer(form.getUsername(),form.getAddress(),form.getPassword(),form.getFullName());
|
||||
return "redirect:/login";
|
||||
}
|
||||
|
@ -68,7 +71,9 @@ public class UserController {
|
|||
user.setFullName(form.getFullName());
|
||||
user.setAddress(form.getAddress());
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue