diff --git a/CHANGELOG.md b/CHANGELOG.md index 0067fce..50e362d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # CHANGELOG ## 1.0.10 - Work In Progress +- Fix #44: Check if the password is empty instead for null value (tonydspaniard) +- Fix #43: Added Table options according to driver type (tonydspaniard) - Fix #42: Allow setting permissions as children to roles (kurounin) - Fix #37: Fix bower alias in test environment (tekord) - Enh #32: Added Italian Translation (maxxer) diff --git a/src/User/Model/User.php b/src/User/Model/User.php index 60c019f..0baba44 100644 --- a/src/User/Model/User.php +++ b/src/User/Model/User.php @@ -185,6 +185,7 @@ class User extends ActiveRecord implements IdentityInterface 'emailTrim' => ['email', 'trim'], // password rules + 'passwordTrim' => ['password', 'trim'], 'passwordRequired' => ['password', 'required', 'on' => ['register']], 'passwordLength' => ['password', 'string', 'min' => 6, 'max' => 72, 'on' => ['register', 'create']], ]; diff --git a/src/User/Service/UserCreateService.php b/src/User/Service/UserCreateService.php index 5a1f7cb..0cab543 100644 --- a/src/User/Service/UserCreateService.php +++ b/src/User/Service/UserCreateService.php @@ -49,7 +49,7 @@ class UserCreateService implements ServiceInterface try { $model->confirmed_at = time(); - $model->password = $model->password !== null + $model->password = !empty($model->password) ? $model->password : $this->securityHelper->generatePassword(8);