Skip to main content

In Craft 3 this is a cinch:

class PluginController extends Controller
{
    // Disable CSRF validation for the entire controller 
    public $enableCsrfValidation = false;

    ...

See the Yii2 docs for more control over inividual actions: https://github.com/yiisoft/yii2/blob/2.1/docs/guide/security-best-practices.md#avoiding-csrfhttps://github.com/yiisoft/yii2/blob/master/docs/guide/security-best-practices.md#avoiding-csrf

In Craft 3 this is a cinch:

class PluginController extends Controller
{
    // Disable CSRF validation for the entire controller 
    public $enableCsrfValidation = false;

    ...

See the Yii2 docs for more control over inividual actions: https://github.com/yiisoft/yii2/blob/2.1/docs/guide/security-best-practices.md#avoiding-csrf

In Craft 3 this is a cinch:

class PluginController extends Controller
{
    // Disable CSRF validation for the entire controller 
    public $enableCsrfValidation = false;

    ...

See the Yii2 docs for more control over inividual actions: https://github.com/yiisoft/yii2/blob/master/docs/guide/security-best-practices.md#avoiding-csrf

Source Link
Ben Croker
  • 7.8k
  • 27
  • 56

In Craft 3 this is a cinch:

class PluginController extends Controller
{
    // Disable CSRF validation for the entire controller 
    public $enableCsrfValidation = false;

    ...

See the Yii2 docs for more control over inividual actions: https://github.com/yiisoft/yii2/blob/2.1/docs/guide/security-best-practices.md#avoiding-csrf