mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 11:16:43 +02:00
refactor: use Validation::getValidated() when using $this->validate() in controllers
This commit is contained in:
parent
ff0e681763
commit
2c07070b2c
18 changed files with 129 additions and 70 deletions
|
|
@ -43,12 +43,14 @@ class MyAccountController extends BaseController
|
|||
->with('errors', $userModel->errors());
|
||||
}
|
||||
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
// check credentials with the old password if logged in without magic link
|
||||
$credentials = [
|
||||
'email' => auth()
|
||||
->user()
|
||||
->email,
|
||||
'password' => $this->request->getPost('password'),
|
||||
'password' => $validData['password'],
|
||||
];
|
||||
|
||||
$validCreds = auth()
|
||||
|
|
@ -62,7 +64,7 @@ class MyAccountController extends BaseController
|
|||
// set new password to user
|
||||
auth()
|
||||
->user()
|
||||
->password = $this->request->getPost('new_password');
|
||||
->password = $validData['new_password'];
|
||||
|
||||
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
||||
return redirect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue