Skip to content

Commit

Permalink
Fix the request token (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed May 6, 2024
1 parent 515a50d commit c528e07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Codefog\MemberExportBundle\Exception\ExportException;
use Contao\BackendTemplate;
use Contao\Controller;
use Contao\CoreBundle\Csrf\ContaoCsrfTokenManager;
use Contao\CoreBundle\Exception\ResponseException;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\Environment;
Expand All @@ -25,6 +26,7 @@
class ExportController
{
public function __construct(
private readonly ContaoCsrfTokenManager $csrfTokenManager,
private readonly ContaoFramework $framework,
private readonly ExporterRegistry $registry,
private readonly RequestStack $requestStack,
Expand Down Expand Up @@ -110,6 +112,7 @@ protected function getTemplate(string $formId): BackendTemplate
$template->action = $environment->get('request');
$template->formId = $formId;
$template->options = $this->generateOptions();
$template->requestToken = $this->csrfTokenManager->getDefaultTokenValue();
$template->message = $message->generate();

return $template;
Expand Down

0 comments on commit c528e07

Please sign in to comment.