I'm getting an "Can't verify CSRF token authenticity" when I try to use my android app to call the create action on one of the controllers in my rails service. Also says "Completed 422 Unprocessable Entity" after that. Any ideas what would cause that? Thanks.
You can disable the built-in CSRF protection Rails uses by default by adding in your controller (ApplicationController or the one being used) the protect_from_forgery
method:
protect_from_forgery with: :null_session
Or also by using the skip_before_action
to "skip" the verify_authenticity_token
implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With