Skip to content

Commit

Permalink
Update LoginController, fix captcha validation error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jan 22, 2024
1 parent 74423b5 commit 0325e17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/Auth/LoginController.php
Expand Up @@ -71,6 +71,7 @@ public function validateLogin($request)
$this->username() => 'required|email',
'password' => 'required|string|min:6',
];
$messages = [];

if(
config('captcha.enabled') ||
Expand All @@ -82,9 +83,9 @@ public function validateLogin($request)
)
) {
$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);
}

/**
Expand Down

0 comments on commit 0325e17

Please sign in to comment.