Skip to content

Instantly share code, notes, and snippets.

@kohaku1907
kohaku1907 / CsrfValidatorSkip.php
Created April 17, 2020 08:35 — forked from ananth-iyer/CsrfValidatorSkip.php
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
<?php
namespace Module\Vendor\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action

Keybase proof

I hereby claim:

  • I am kohaku1907 on github.
  • I am kshiro (https://keybase.io/kshiro) on keybase.
  • I have a public key ASAoaYqlGV1HtrZ0_nN4xBNxgCEw0nOT6QUd5JzC-E0FqAo

To claim this, I am signing this object: