From 937a0206a512f5fdf44b0b2c56d8eadb5878e185 Mon Sep 17 00:00:00 2001 From: Miguel N Date: Tue, 8 Sep 2020 01:38:56 +0100 Subject: [PATCH] Added existing account check to logs --- app/Listeners/LogAuthenticationFailure.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Listeners/LogAuthenticationFailure.php b/app/Listeners/LogAuthenticationFailure.php index 4286928..afe1fee 100644 --- a/app/Listeners/LogAuthenticationFailure.php +++ b/app/Listeners/LogAuthenticationFailure.php @@ -27,6 +27,7 @@ class LogAuthenticationFailure public function handle($event) { $targetAccountID = 0; + $originalIP = "0.0.0.0"; if (isset($event->user->id)) { @@ -37,7 +38,7 @@ class LogAuthenticationFailure 'targetAccountID' => $targetAccountID, 'existingAccount' => ($targetAccountID == 0) ? false : true, 'sourceIP' => request()->ip(), - 'matchesAccountLastIP' => request()->ip() == $event->user->originalIP, + 'matchesAccountLastIP' => request()->ip() == $originalIP, 'sourceUserAgent' => request()->userAgent(), ]); }