mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 08:52:00 +00:00
fix(auth): display error messages from validator
This commit is contained in:
parent
fcad25a551
commit
5a834c0f89
@ -24,7 +24,7 @@ class InteractController extends Controller
|
|||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', service('validation')->getErrors());
|
->with('errors', $this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$validData = $this->validator->getValidated();
|
$validData = $this->validator->getValidated();
|
||||||
|
@ -45,12 +45,11 @@ class MagicLinkController extends ShieldMagicLinkController
|
|||||||
'new_password' => 'required|strong_password',
|
'new_password' => 'required|strong_password',
|
||||||
];
|
];
|
||||||
|
|
||||||
$userModel = new UserModel();
|
|
||||||
if (! $this->validate($rules)) {
|
if (! $this->validate($rules)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $userModel->errors());
|
->with('errors', $this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$validData = $this->validator->getValidated();
|
$validData = $this->validator->getValidated();
|
||||||
@ -60,6 +59,7 @@ class MagicLinkController extends ShieldMagicLinkController
|
|||||||
->user()
|
->user()
|
||||||
->password = $validData['new_password'];
|
->password = $validData['new_password'];
|
||||||
|
|
||||||
|
$userModel = new UserModel();
|
||||||
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
|
@ -35,12 +35,11 @@ class MyAccountController extends BaseController
|
|||||||
'new_password' => 'required|strong_password|differs[password]',
|
'new_password' => 'required|strong_password|differs[password]',
|
||||||
];
|
];
|
||||||
|
|
||||||
$userModel = new UserModel();
|
|
||||||
if (! $this->validate($rules)) {
|
if (! $this->validate($rules)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $userModel->errors());
|
->with('errors', $this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$validData = $this->validator->getValidated();
|
$validData = $this->validator->getValidated();
|
||||||
@ -66,6 +65,7 @@ class MyAccountController extends BaseController
|
|||||||
->user()
|
->user()
|
||||||
->password = $validData['new_password'];
|
->password = $validData['new_password'];
|
||||||
|
|
||||||
|
$userModel = new UserModel();
|
||||||
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
if (! $userModel->update(auth()->user()->id, auth()->user())) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
|
@ -290,12 +290,11 @@ class InstallController extends Controller
|
|||||||
'password' => 'required|strong_password',
|
'password' => 'required|strong_password',
|
||||||
];
|
];
|
||||||
|
|
||||||
$userModel = new UserModel();
|
|
||||||
if (! $this->validate($rules)) {
|
if (! $this->validate($rules)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $userModel->errors());
|
->with('errors', $this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$validData = $this->validator->getValidated();
|
$validData = $this->validator->getValidated();
|
||||||
@ -308,6 +307,7 @@ class InstallController extends Controller
|
|||||||
'is_owner' => true,
|
'is_owner' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$userModel = new UserModel();
|
||||||
try {
|
try {
|
||||||
$userModel->save($user);
|
$userModel->save($user);
|
||||||
} catch (ValidationException) {
|
} catch (ValidationException) {
|
||||||
|
@ -20,7 +20,7 @@ use Modules\Auth\Config\Auth;
|
|||||||
required="true"
|
required="true"
|
||||||
type="email"
|
type="email"
|
||||||
inputmode="email"
|
inputmode="email"
|
||||||
autocomplete="email"
|
autocomplete="username"
|
||||||
autofocus="autofocus"
|
autofocus="autofocus"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
name="email"
|
name="email"
|
||||||
label="<?= lang('Install.form.email') ?>"
|
label="<?= lang('Install.form.email') ?>"
|
||||||
type="email"
|
type="email"
|
||||||
|
autocomplete="username"
|
||||||
required="true" />
|
required="true" />
|
||||||
|
|
||||||
<Forms.Field
|
<Forms.Field
|
||||||
|
Loading…
x
Reference in New Issue
Block a user