Skip to content

Commit

Permalink
feat: add LoginViaRemember subscribe method (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Apr 3, 2024
1 parent 4b154e1 commit 053e391
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Listeners/LoginViaRemember.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -28,4 +29,16 @@ private function registerWebauthn(User $user)
Webauthn::login($user);
}
}

/**
* Register the listeners for the subscriber.
*
* @return array<string, string>
*/
public function subscribe(Dispatcher $events): array
{
return [
Login::class => 'handle',
];
}
}

0 comments on commit 053e391

Please sign in to comment.