Skip to content

Commit

Permalink
Don't require CSRF valdiation for preview requests
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jun 18, 2019
1 parent 41324fd commit 54831ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/controllers/PreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ class PreviewController extends Controller
// Public Methods
// =========================================================================

/**
* @inheritdoc
*/
public function beforeAction($action)
{
// Don't require CSRF validation for POSTed preview requests
if ($action->id === 'preview') {
$this->enableCsrfValidation = false;
}

return parent::beforeAction($action);
}

/**
* Creates a token for previewing/sharing an element.
*
Expand Down

0 comments on commit 54831ac

Please sign in to comment.