0

I have a blog application in ruby on rails which is finely working in the development side. But when I try to deploy it into the heroku I am getting the Can't verify CSRF token authenticity and Completed 401 Unauthorized error in the heroku log while creating a new post in my application.I also seen many previously asked questions and included protect_from_forgery with: :null_session. But the error is same. How to resolve it. I have included the git repository for your reference.git repository of my application

Praveen R
  • 190
  • 3
  • 13

1 Answers1

1

Add below line in controller .

skip_before_action :verify_authenticity_token

You can need to add action in which problem is coming

:only/:except - Only apply forgery protection to a subset of actions.

For example only: [ :create, :create_all ]

Bodh1004
  • 309
  • 3
  • 9