Added minimum password requirements

This commit is contained in:
MatteoF96
2022-01-10 12:34:57 +01:00
parent 504e18c855
commit 43fd2fdc34
5 changed files with 52 additions and 11 deletions

View File

@ -57,7 +57,7 @@ class UserCreateService implements ServiceInterface
$model->confirmed_at = time();
$model->password = !empty($model->password)
? $model->password
: $this->securityHelper->generatePassword(8);
: $this->securityHelper->generatePassword(8, $this->getModule('user')->minPasswordRequirements);
/** @var UserEvent $event */
$event = $this->make(UserEvent::class, [$model]);

View File

@ -51,7 +51,7 @@ class UserRegisterService implements ServiceInterface
try {
$model->confirmed_at = $this->getModule()->enableEmailConfirmation ? null : time();
$model->password = $this->getModule()->generatePasswords
? $this->securityHelper->generatePassword(8)
? $this->securityHelper->generatePassword(8, $this->getModule('user')->minPasswordRequirements)
: $model->password;
$event = $this->make(UserEvent::class, [$model]);