fix: [user] Allow password update and hiden confirm_password field
parent
974d3197e8
commit
7029341e40
|
@ -196,9 +196,10 @@ class CRUDComponent extends Component
|
|||
}
|
||||
}
|
||||
if (!empty($params['removeEmpty'])) {
|
||||
foreach ($params['removeEmpty'] as $removeEmptyField)
|
||||
if (isset($input[$removeEmptyField])) {
|
||||
unset($input[$removeEmptyField]);
|
||||
foreach ($params['removeEmpty'] as $removeEmptyField) {
|
||||
if (empty($input[$removeEmptyField])) {
|
||||
unset($input[$removeEmptyField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $input;
|
||||
|
|
|
@ -8,7 +8,7 @@ use Authentication\PasswordHasher\DefaultPasswordHasher;
|
|||
|
||||
class User extends AppModel
|
||||
{
|
||||
protected $_hidden = ['password'];
|
||||
protected $_hidden = ['password', 'confirm_password'];
|
||||
protected function _setPassword(string $password) : ?string
|
||||
{
|
||||
if (strlen($password) > 0) {
|
||||
|
|
Loading…
Reference in New Issue