buckets/src/Security/LogoutSubscriber.php

23 lines
554 B
PHP
Raw Normal View History

<?php
namespace App\Security;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Event\LogoutEvent;
final class LogoutSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
LogoutEvent::class => 'onLogout',
];
}
public function onLogout(LogoutEvent $event): void
{
$event->setResponse(new Response(null, Response::HTTP_NO_CONTENT));
}
}