diff --git a/README.md b/README.md index 9c2ebd3..6b2e227 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/rappasoft/laravel-authentication-log.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-authentication-log) [![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 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, 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')) {