Added existing account check to logs

This commit is contained in:
Miguel Nogueira 2020-09-08 01:38:56 +01:00
parent 3598a32ecf
commit 937a0206a5
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ class LogAuthenticationFailure
public function handle($event) public function handle($event)
{ {
$targetAccountID = 0; $targetAccountID = 0;
$originalIP = "0.0.0.0";
if (isset($event->user->id)) if (isset($event->user->id))
{ {
@ -37,7 +38,7 @@ class LogAuthenticationFailure
'targetAccountID' => $targetAccountID, 'targetAccountID' => $targetAccountID,
'existingAccount' => ($targetAccountID == 0) ? false : true, 'existingAccount' => ($targetAccountID == 0) ? false : true,
'sourceIP' => request()->ip(), 'sourceIP' => request()->ip(),
'matchesAccountLastIP' => request()->ip() == $event->user->originalIP, 'matchesAccountLastIP' => request()->ip() == $originalIP,
'sourceUserAgent' => request()->userAgent(), 'sourceUserAgent' => request()->userAgent(),
]); ]);
} }