From 46e959ccb8bc987f0e339c76e4525659aa977b94 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 27 Jun 2024 14:23:38 +0800 Subject: [PATCH] [1.x] Use available `$name` property from `SessionGuard` if the value exists Introduced in Laravel Framwork 10.0.0: https://github.com/laravel/framework/pull/43163 Signed-off-by: Mior Muhammad Zaki --- src/Actions/AttemptToAuthenticate.php | 2 +- src/Actions/RedirectIfTwoFactorAuthenticatable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Actions/AttemptToAuthenticate.php b/src/Actions/AttemptToAuthenticate.php index 49011d71..db1898f6 100644 --- a/src/Actions/AttemptToAuthenticate.php +++ b/src/Actions/AttemptToAuthenticate.php @@ -107,7 +107,7 @@ protected function throwFailedAuthenticationException($request) */ protected function fireFailedEvent($request) { - event(new Failed(config('fortify.guard'), null, [ + event(new Failed($this->guard?->name ?? config('fortify.guard'), null, [ Fortify::username() => $request->{Fortify::username()}, 'password' => $request->password, ])); diff --git a/src/Actions/RedirectIfTwoFactorAuthenticatable.php b/src/Actions/RedirectIfTwoFactorAuthenticatable.php index 878f6b60..03fa8075 100644 --- a/src/Actions/RedirectIfTwoFactorAuthenticatable.php +++ b/src/Actions/RedirectIfTwoFactorAuthenticatable.php @@ -123,7 +123,7 @@ protected function throwFailedAuthenticationException($request) */ protected function fireFailedEvent($request, $user = null) { - event(new Failed(config('fortify.guard'), $user, [ + event(new Failed($this->guard?->name ?? config('fortify.guard'), $user, [ Fortify::username() => $request->{Fortify::username()}, 'password' => $request->password, ]));