Added existing account check to logs

This commit is contained in:
Miguel Nogueira 2020-09-08 01:37:33 +01:00
parent ac8b303e2c
commit 3598a32ecf

View File

@ -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(),