From 053e39154a2d40bd797a866d22154c7f1659f5cd Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Wed, 3 Apr 2024 17:00:36 +0200 Subject: [PATCH] feat: add LoginViaRemember subscribe method (#484) --- src/Listeners/LoginViaRemember.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Listeners/LoginViaRemember.php b/src/Listeners/LoginViaRemember.php index 3a11b0e..5a7330e 100644 --- a/src/Listeners/LoginViaRemember.php +++ b/src/Listeners/LoginViaRemember.php @@ -4,6 +4,7 @@ use Illuminate\Auth\Events\Login; use Illuminate\Contracts\Auth\Authenticatable as User; +use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Auth; use LaravelWebauthn\Facades\Webauthn; @@ -28,4 +29,16 @@ private function registerWebauthn(User $user) Webauthn::login($user); } } + + /** + * Register the listeners for the subscriber. + * + * @return array + */ + public function subscribe(Dispatcher $events): array + { + return [ + Login::class => 'handle', + ]; + } }