Properly use env/config functions

This commit is contained in:
benrubson 2020-05-23 12:06:37 +02:00
parent 58df3ad956
commit 8f1f73defa
2 changed files with 6 additions and 1 deletions

View File

@ -79,4 +79,9 @@ return [
],
],
// Failed Access Message
// Defines the message to log into webserver logs in case of failed access,
// for further processing by tools like Fail2Ban.
'failed_access_message' => env('FAILED_ACCESS_MESSAGE', ''),
];

View File

@ -176,7 +176,7 @@ class LoginController extends Controller
*/
protected function logFailedAccess($request)
{
$log_msg = env('FAILED_ACCESS_MESSAGE', '');
$log_msg = config('logging.failed_access_message');
if (!is_string($request->get($this->username())) || !is_string($log_msg) || strlen($log_msg)<1)
return;