Fix #44 check for empty values instead of null values
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## 1.0.10 - Work In Progress
|
## 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 #42: Allow setting permissions as children to roles (kurounin)
|
||||||
- Fix #37: Fix bower alias in test environment (tekord)
|
- Fix #37: Fix bower alias in test environment (tekord)
|
||||||
- Enh #32: Added Italian Translation (maxxer)
|
- Enh #32: Added Italian Translation (maxxer)
|
||||||
|
|||||||
@ -185,6 +185,7 @@ class User extends ActiveRecord implements IdentityInterface
|
|||||||
'emailTrim' => ['email', 'trim'],
|
'emailTrim' => ['email', 'trim'],
|
||||||
|
|
||||||
// password rules
|
// password rules
|
||||||
|
'passwordTrim' => ['password', 'trim'],
|
||||||
'passwordRequired' => ['password', 'required', 'on' => ['register']],
|
'passwordRequired' => ['password', 'required', 'on' => ['register']],
|
||||||
'passwordLength' => ['password', 'string', 'min' => 6, 'max' => 72, 'on' => ['register', 'create']],
|
'passwordLength' => ['password', 'string', 'min' => 6, 'max' => 72, 'on' => ['register', 'create']],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class UserCreateService implements ServiceInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$model->confirmed_at = time();
|
$model->confirmed_at = time();
|
||||||
$model->password = $model->password !== null
|
$model->password = !empty($model->password)
|
||||||
? $model->password
|
? $model->password
|
||||||
: $this->securityHelper->generatePassword(8);
|
: $this->securityHelper->generatePassword(8);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user