I have a Rails application and I make requests through posts and I respond on json, however, because of this line
protection_from_forgery with: :exception
it doesn't let me proceed the request, I read somewhere that adding this line instead of the previous would help
protect_from_forgery unless: -> {request.format.json?}
And, in fact, it does help, but I'm not sure that it's right to remove the line in the past just to accept json, what could be the right way to do this without removing the exception in the first line?
Well the solution was adding protect_from_forgery to the controller that I was responding with.
Aparentally adding that makes it respond with null sesion by default and that fixes the issue.