Fix #44 check for empty values instead of null values

This commit is contained in:
Antonio Ramirez
2017-08-06 12:00:59 +02:00
parent fbf2945ac5
commit 4b96d8057c
3 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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']],
];

View File

@ -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);