refonte
This commit is contained in:
23
src/EventSubscriber/LogoutSubscriber.php
Normal file
23
src/EventSubscriber/LogoutSubscriber.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\EventSubscriber;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Http\Event\LogoutEvent;
|
||||
|
||||
class LogoutSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public function onLogoutEvent(LogoutEvent $event): void
|
||||
{
|
||||
$response = new Response(null, 204);
|
||||
$event->setResponse($response);
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
LogoutEvent::class => 'onLogoutEvent',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user