diff --git a/app/Listeners/LogAuthenticationFailure.php b/app/Listeners/LogAuthenticationFailure.php index 3ce94c7..4286928 100644 --- a/app/Listeners/LogAuthenticationFailure.php +++ b/app/Listeners/LogAuthenticationFailure.php @@ -26,8 +26,16 @@ class LogAuthenticationFailure */ public function handle($event) { + $targetAccountID = 0; + + if (isset($event->user->id)) + { + $targetAccountID = $event->user->id; + } + Log::alert('SECURITY (login): Detected failed authentication attempt!', [ - 'targetAccountID' => $event->user->id ?? '(nonexistent user)', + 'targetAccountID' => $targetAccountID, + 'existingAccount' => ($targetAccountID == 0) ? false : true, 'sourceIP' => request()->ip(), 'matchesAccountLastIP' => request()->ip() == $event->user->originalIP, 'sourceUserAgent' => request()->userAgent(),