Skip to content

Commit

Permalink
BUGFIX: Disable CSRF Protection for the plugin contentcontroller, to …
Browse files Browse the repository at this point in the history
…avoid it throwing when the main request is a POST
  • Loading branch information
Bastian Heist committed Aug 21, 2018
1 parent 7cafc92 commit a41084d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Classes/Controller/Plugin/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class ContentController extends ActionController
*/
protected $xAPISettings;

/**
* CSRF protection is disabled here as Flow requires a CSRF token if the main request was a POST, which
* we obviously never have in a plugin request.
* @Flow\SkipCsrfProtection
*
* @throws \Neos\ContentRepository\Exception\NodeException
*/
public function contentAction()
{
/** @var NodeInterface $node */
Expand All @@ -43,6 +50,14 @@ public function contentAction()
$this->view->assign('content', $content);
}

/**
* CSRF protection is disabled here as Flow requires a CSRF token if the main request was a POST, which
* we obviously never have in a plugin request.
* @Flow\SkipCsrfProtection
*
* @return bool
* @throws \Neos\ContentRepository\Exception\NodeException
*/
public function scriptsAndStylesAction()
{
/** @var array $h5pContentNodes */
Expand Down

0 comments on commit a41084d

Please sign in to comment.