Update LoginController, fix captcha validation error message

This commit is contained in:
Daniel Supernault 2024-01-22 03:06:14 -07:00
parent 74423b52ca
commit 0325e17115
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -71,6 +71,7 @@ class LoginController extends Controller
$this->username() => 'required|email',
'password' => 'required|string|min:6',
];
$messages = [];
if(
config('captcha.enabled') ||
@ -82,9 +83,9 @@ class LoginController extends Controller
)
) {
$rules['h-captcha-response'] = 'required|filled|captcha|min:5';
$messages['h-captcha-response.required'] = 'The captcha must be filled';
}
$this->validate($request, $rules);
$request->validate($rules, $messages);
}
/**