Skip to content

Commit

Permalink
Check if request is for RequestProtectedAccessType only on POST request
Browse files Browse the repository at this point in the history
  • Loading branch information
RemyNovactive committed Jul 5, 2024
1 parent 11472ff commit aca7d2c
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ class PasswordProvided
/**
* @var FormFactoryInterface
*/
private $formFactory;

public function __construct(FormFactoryInterface $formFactory)
{
$this->formFactory = $formFactory;
}
public function __construct(private readonly FormFactoryInterface $formFactory)
{ }

public function onKernelRequest(RequestEvent $event): void
{
if (!$event->isMasterRequest()) {
if (!$event->isMainRequest()) {
return;
}
if (!$event->getRequest()->isMethod('POST')) {
return;
}
$form = $this->formFactory->create(RequestProtectedAccessType::class);
Expand Down

0 comments on commit aca7d2c

Please sign in to comment.