croxton / Stash

Stash allows you to stash text and snippets of code for reuse throughout your templates.
GNU General Public License v3.0
198 stars 20 forks source link

Error on API hook with POST request #141

Closed ThinkGraphical closed 8 years ago

ThinkGraphical commented 8 years ago

I'm trying to clear the mustash cache with a post_deploy hook. This works when i perform a GET request to the respected URL.

When using Beanstalk the post_deploy hook sends out a POST request instead of a GET request.

This results in following error:

The following errors were encountered
This form has expired. Please refresh and try again.

I was wondering if there's a way to get this working with a POST request?

croxton commented 8 years ago

That error message is coming from EE, not Mustash. EE automatically intercepts POST requests and will show that message if a valid CSRF token is not found.

What you could do is change the value to '1' in the csrf_exempt column for the Mustash API action in the exp_actions table. That should work (not tested).

ThinkGraphical commented 8 years ago

I knew it had something to do with the 'secure forms' but didn't know you could disable it specifically this way.

Thanks, it works!