Skip to content

Commit dc08371

Browse files
iedexifox
authored andcommitted
Added validation on new password field when a user resets it from their profile
1 parent 541a8a7 commit dc08371

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Http/Requests/Admin/UserRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Facades\Auth;
66
use Illuminate\Validation\Rule;
7+
use Illuminate\Validation\Rules\Password;
78
use PragmaRX\Google2FA\Google2FA;
89

910
class UserRequest extends Request
@@ -36,6 +37,7 @@ public function rules(): array
3637
'twill.users_table',
3738
'twill_users'
3839
) . ',email,' . $this->route('user'),
40+
'new_password' => (!empty($this->get('reset_password')) && !empty($this->get('new_password')) ? Password::defaults() : ''),
3941
'verify-code' => function ($attribute, $value, $fail) {
4042
$user = Auth::guard('twill_users')->user();
4143
$with2faSettings = config('twill.enabled.users-2fa') && $user->id == $this->route('user');

0 commit comments

Comments
 (0)