diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index 543fdd0a5..5cb5294df 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -2,6 +2,8 @@ module Api class EventsController < ApplicationController + skip_before_action :verify_authenticity_token, if: :json_request? + KNOWN_EVENTS = %w( activity workflow_activity ) def self.resource_name diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1687f0342..c0b9eb6fd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -35,4 +35,8 @@ def configure_permitted_parameters def paper_trail_enabled_for_controller false end + + def json_request? + request.format.json? + end end