mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 11:16:43 +02:00
fix(auth): display error messages from validator
This commit is contained in:
parent
fcad25a551
commit
5a834c0f89
6 changed files with 9 additions and 8 deletions
|
|
@ -45,12 +45,11 @@ class MagicLinkController extends ShieldMagicLinkController
|
|||
'new_password' => 'required|strong_password',
|
||||
];
|
||||
|
||||
$userModel = new UserModel();
|
||||
if (! $this->validate($rules)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $userModel->errors());
|
||||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$validData = $this->validator->getValidated();
|
||||
|
|
@ -60,6 +59,7 @@ class MagicLinkController extends ShieldMagicLinkController
|
|||
->user()
|
||||
->password = $validData['new_password'];
|
||||
|
||||
$userModel = new UserModel();
|
||||
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
||||
return redirect()
|
||||
->back()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue