In the controller where you want to disable CSRF, check:
skip_before_action :verify_authenticity_token
Or disable it for everything but a few methods:
skip_before_action :verify_authenticity_token, :except => [:update, :create]
Or disable only the specified methods:
skip_before_action :verify_authenticity_token, :only => [:custom_auth, :update]
Additional Information: RoR Request Forgery Protection
Mike Lewis Apr 14 2018-11-11T00: 00Z
source share