Reputation: 417
Just after a new deploy all POST request started throwing error 422 and "Can't verify CSRF token authenticity."
I rolled back to previous deploy and worked. I suspected an error on the code base (all thou nothing looked strange). So reverted to the exact same code as the build that worked. Push again but didn't help.
Have tried:
Any advise apreciated.
Using rails 5.0.7.2
Upvotes: 1
Views: 631
Reputation: 417
It was Rails5 + Heroku + CloudFlare as explained here:
http://til.obiefernandez.com/posts/875a2a69af-cloudflare-flexible-ssl-mode-breaks-rails-5-csrf
"The solution is simple. Make sure you have working SSL and HTTPS on Heroku (or wherever you're serving your Rails application.) Turn Cloudflare SSL to Full mode. Problem solved."
Upvotes: 0