src/EventListener/CsrfDisabler.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use Pimcore\Bundle\AdminBundle\Security\CsrfProtectionHandler;
  4. use Pimcore\Http\Request\Resolver\PimcoreContextResolver;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. use Symfony\Component\HttpKernel\Event\RequestEvent;
  7. use Symfony\Component\HttpKernel\KernelEvents;
  8. use Pimcore\Bundle\CoreBundle\EventListener\Traits\PimcoreContextAwareTrait;
  9. class CsrfDisabler implements EventSubscriberInterface
  10. {
  11.     use PimcoreContextAwareTrait;
  12.     protected $csrfProtectionHandler;
  13.     public function __construct(CsrfProtectionHandler $csrfProtectionHandler)
  14.     {
  15.         $this->csrfProtectionHandler $csrfProtectionHandler;
  16.     }
  17.     public static function getSubscribedEvents(): array
  18.     {
  19.         return [
  20.             KernelEvents::REQUEST => ['handleRequest'11],
  21.         ];
  22.     }
  23.     public function handleRequest(RequestEvent $event)
  24.     {
  25.         return;
  26.     }
  27. }