From ab9c5211ba456a981d77083c06d5664676ad5f27 Mon Sep 17 00:00:00 2001 From: Anthony Rappa Date: Thu, 28 Mar 2024 20:37:47 -0400 Subject: [PATCH 1/3] Revert "Merge pull request #100 from mazur-adam/patch-1" This reverts commit 1621f54ed3034e52e5bfb95878191b98c0ae0efc, reversing changes made to bdedfee70f9cd885d83e602f5a16655fab1e8a93. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 755ec30..6e481db 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ [![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/rappasoft/laravel-authentication-log/Check%20&%20fix%20styling?label=code%20style)](https://github.com/rappasoft/laravel-authentication-log/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/laravel-authentication-log.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-authentication-log) -### Enjoying this package? [Buy me a beer 🍺](https://www.buymeacoffee.com/rappasoft) - Laravel Authentication Log is a package which tracks your user's authentication information such as login/logout time, IP, Browser, Location, etc. as well as sends out notifications via mail, slack, or sms for new devices and failed logins. ## Documentation, Installation, and Usage Instructions From 4f4e4365f397d11b7016a687e772c92530752d69 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 9 Feb 2025 09:22:59 +0000 Subject: [PATCH 2/3] Check if geoip is installed --- config/authentication-log.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/authentication-log.php b/config/authentication-log.php index bcb0a4e..8d46e5f 100644 --- a/config/authentication-log.php +++ b/config/authentication-log.php @@ -29,7 +29,7 @@ 'enabled' => env('NEW_DEVICE_NOTIFICATION', true), // Use torann/geoip to attempt to get a location - 'location' => true, + 'location' => function_exists('geoip'), // The Notification class to send 'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\NewDevice::class, @@ -39,7 +39,7 @@ 'enabled' => env('FAILED_LOGIN_NOTIFICATION', false), // Use torann/geoip to attempt to get a location - 'location' => true, + 'location' => function_exists('geoip'), // The Notification class to send 'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\FailedLogin::class, From 7fb2858821956316228a7e81b5fa6a53ac6aca96 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 9 Feb 2025 09:26:55 +0000 Subject: [PATCH 3/3] Update failed login config --- src/Listeners/FailedLoginListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Listeners/FailedLoginListener.php b/src/Listeners/FailedLoginListener.php index ab2effc..419b23d 100644 --- a/src/Listeners/FailedLoginListener.php +++ b/src/Listeners/FailedLoginListener.php @@ -40,7 +40,7 @@ public function handle($event): void 'user_agent' => $this->request->userAgent(), 'login_at' => now(), 'login_successful' => false, - 'location' => config('authentication-log.notifications.new-device.location') ? optional(geoip()->getLocation($ip))->toArray() : null, + 'location' => config('authentication-log.notifications.failed-login.location') ? optional(geoip()->getLocation($ip))->toArray() : null, ]); if (config('authentication-log.notifications.failed-login.enabled')) {