From 05b41b658aaf81df32bcf97c58be52f15a75793b Mon Sep 17 00:00:00 2001 From: robertosanchez Date: Fri, 23 May 2025 09:55:46 +0200 Subject: [PATCH 1/6] Fixed default value when state location value is not available --- resources/views/emails/failed.blade.php | 2 +- resources/views/emails/new.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/emails/failed.blade.php b/resources/views/emails/failed.blade.php index 432eaf5..a3298d5 100644 --- a/resources/views/emails/failed.blade.php +++ b/resources/views/emails/failed.blade.php @@ -8,7 +8,7 @@ > **@lang('IP Address:')** {{ $ipAddress }}
> **@lang('Browser:')** {{ $browser }}
@if ($location && $location['default'] === false) -> **@lang('Location:')** {{ $location['city'] ?? __('Unknown City') }}, {{ $location['state'], __('Unknown State') }} +> **@lang('Location:')** {{ $location['city'] ?? __('Unknown City') }}, {{ $location['state'] ?? __('Unknown State') }} @endif @lang('If this was you, you can ignore this alert. If you suspect any suspicious activity on your account, please change your password.') diff --git a/resources/views/emails/new.blade.php b/resources/views/emails/new.blade.php index 2a8b7a2..333d0d0 100644 --- a/resources/views/emails/new.blade.php +++ b/resources/views/emails/new.blade.php @@ -8,7 +8,7 @@ > **@lang('IP Address:')** {{ $ipAddress }}
> **@lang('Browser:')** {{ $browser }}
@if ($location && $location['default'] === false) -> **@lang('Location:')** {{ $location['city'] ?? __('Unknown City') }}, {{ $location['state'], __('Unknown State') }} +> **@lang('Location:')** {{ $location['city'] ?? __('Unknown City') }}, {{ $location['state'] ?? __('Unknown State') }} @endif @lang('If this was you, you can ignore this alert. If you suspect any suspicious activity on your account, please change your password.') From 72a4f2d0e34e947790f3fda8389c5a04e1750345 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Fri, 23 May 2025 23:06:33 +0100 Subject: [PATCH 2/6] Add Spanish Localisation --- resources/lang/es_ES.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 resources/lang/es_ES.json diff --git a/resources/lang/es_ES.json b/resources/lang/es_ES.json new file mode 100644 index 0000000..b4fee87 --- /dev/null +++ b/resources/lang/es_ES.json @@ -0,0 +1,15 @@ +{ + "A failed login to your account": "Inicio de sesión incorrecto en su cuenta", + "Account:": "Cuenta:", + "Browser:": "Navegador:", + "Hello!": "¡Hola!", + "If this was you, you can ignore this alert. If you suspect any suspicious activity on your account, please change your password.": "Si ha sido usted, puede ignorar esta alerta. Si sospecha de cualquier actividad extraña en su cuenta, por favor cambie su password.", + "IP Address:": "Dirección IP:", + "Location:": "Localización:", + "Regards,": "Reciba un cordial saludo,", + "There has been a failed login attempt to your :app account.": "Se ha producido un intento de inicio de sesión erróneo con su cuenta en :app.", + "Time:": "Hora:", + "Unknown City": "Ciudad Desconocida", + "Unknown State": "Provincia desconocida", + "Your :app account logged in from a new device.": "Su cuenta en :app ha iniciado sesión desde un nuevo dispositivo." +} \ No newline at end of file From 95c294d1c532691b2010a779f22bbea981c2a6ee Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sat, 24 May 2025 03:40:01 +0100 Subject: [PATCH 3/6] Composer adjustments for vresions --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 55298b1..a16b15d 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,12 @@ "spatie/laravel-package-tools": "^1.4.3" }, "require-dev": { - "nunomaduro/collision": "^6.0", - "orchestra/testbench": "^7.0|^10.0", - "pestphp/pest": "^1.21|^3.7", - "pestphp/pest-plugin-laravel": "^1.2|^3.1", + "nunomaduro/collision": "^6.0|^7.0|^8.0", + "orchestra/testbench": "^7.0|^8.0|^9.0|^10.0", + "pestphp/pest": "^1.21|^2.0|^3.7", + "pestphp/pest-plugin-laravel": "^1.2|^2.0|^3.1", "spatie/laravel-ray": "^1.29", - "vimeo/psalm": "^4.20|^6.6" + "vimeo/psalm": "^4.20|^5.0|^6.6" }, "autoload": { "psr-4": { From 6c77cff992b1fbf0089ff4162b3a25b4ba92b5aa Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sat, 24 May 2025 03:47:39 +0100 Subject: [PATCH 4/6] Remove FailFast From Tests --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b52c132..f9fda6a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: - fail-fast: true + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] php: [8.1, '8.2', '8.3', '8.4'] From 5a11cffccd7844c4f342bf24c478fb838f7d7a77 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sat, 24 May 2025 03:51:17 +0100 Subject: [PATCH 5/6] Test adding Laravel 11.x --- .github/workflows/run-tests.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f9fda6a..41d3482 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,15 +18,19 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php: [8.1, '8.2', '8.3', '8.4'] - laravel: ['10.*', '12.*'] + php: [8.1, 8.2, 8.3, 8.4] + laravel: ['10.*', '11.*', '12.*'] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* - testbench: 8.0 + testbench: 8.* + - laravel: 11.* + testbench: 9.* - laravel: 12.* - testbench: '10.0' + testbench: 10.* exclude: + - laravel: 11.* + php: 8.1 - laravel: 12.* php: 8.1 From 791a76d7f3b20e39b861256cee3f53f2fe3d7765 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sat, 24 May 2025 04:03:48 +0100 Subject: [PATCH 6/6] Use location from failed-login not new-device 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 8c76dee..3d4c656 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')) {