Skip to content

Commit

Permalink
fix: event listener wrong namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
addeeandra committed Oct 10, 2024
1 parent cd59e26 commit 6d481c2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/Listeners/ClearStoredSessionIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

class ClearStoredSessionIP
{
public function handle(Logout $event, Paranoia $driver): void
public function handle(Logout $event): void
{
/** @var Paranoia $driver */
$driver = app('paranoia');

if ($driver->useCookieForIP()) {
$driver->cookieLayer(CookieLayer::IP)->clearCookie();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Listeners/ClearStoredSessionUserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

class ClearStoredSessionUserAgent
{
public function handle(Logout $event, Paranoia $driver): void
public function handle(Logout $event): void
{
/** @var Paranoia $driver */
$driver = app('paranoia');

if ($driver->useCookieForUserAgent()) {
$driver->cookieLayer(CookieLayer::USER_AGENT)->clearCookie();
}
Expand Down
7 changes: 2 additions & 5 deletions src/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@
use Dentro\Paranoia\Listeners\StoreSessionUserAgent;
use Illuminate\Auth\Events\Login;
use Illuminate\Auth\Events\Logout;
use Illuminate\Events\EventServiceProvider as ServiceProvider;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
/**
* @var array<string, array<string>>
*/
protected array $listen = [
protected $listen = [
Login::class => [
StoreSessionIP::class,
StoreSessionUserAgent::class,
Expand Down

0 comments on commit 6d481c2

Please sign in to comment.