updateAttributes fails! fix methodology
This commit is contained in:
@ -23,17 +23,14 @@ class ResetPasswordService implements ServiceInterface
|
|||||||
|
|
||||||
public function __construct($password, User $model, SecurityHelper $securityHelper)
|
public function __construct($password, User $model, SecurityHelper $securityHelper)
|
||||||
{
|
{
|
||||||
$this->password;
|
$this->password = $password;
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->securityHelper = $securityHelper;
|
$this->securityHelper = $securityHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
return $this->model && (bool)$this->model->updateAttributes(
|
$this->model->password = $this->password;
|
||||||
[
|
return (bool)$this->model->save(false, ['password_hash']);
|
||||||
'password_hash' => $this->securityHelper->generatePasswordHash($this->password),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user