Skip csrf verification in pyrocms

92 Views Asked by At

I need to skip csrf verification for one of my endpoint. So I add that route to $except array in Anomaly\Streams\Platform\Http\Middleware\VerifyCsrfToken like this,

protected $except = [ "/payments/notify" ];

But still it not skip the csrf verification. So, please help me with this.

3

There are 3 best solutions below

1
Akash Kumar Verma On

try this

protected $except = [
     "payments/notify",
     "payments/notify/*"
 ];
0
Piterden On

You can use the api middleware group:

enter image description here

Or either you can use the resource controller:

enter image description here

0
Ryan Thompson On

There are a few ways to do it listed in documentation. This page should get you started (see included links on page for more options too): https://pyrocms.com/documentation/streams-platform/1.6/the-basics/csrf-protection