diff --git a/app/controllers/api/v1/conferences_controller.rb b/app/controllers/api/v1/conferences_controller.rb index 1fddf1b4..60578587 100644 --- a/app/controllers/api/v1/conferences_controller.rb +++ b/app/controllers/api/v1/conferences_controller.rb @@ -4,6 +4,9 @@ module Api load_resource find_by: :short_title respond_to :json + # Disable forgery protection for any json requests. This is required for jsonp support + skip_before_action :verify_authenticity_token + def index render json: @conferences, serializer: ConferencesArraySerializer, callback: params['callback'] end diff --git a/app/controllers/api/v1/events_controller.rb b/app/controllers/api/v1/events_controller.rb index 20578dd8..1cb01ad9 100644 --- a/app/controllers/api/v1/events_controller.rb +++ b/app/controllers/api/v1/events_controller.rb @@ -4,6 +4,9 @@ module Api load_resource :conference, find_by: :short_title respond_to :json + # Disable forgery protection for any json requests. This is required for jsonp support + skip_before_action :verify_authenticity_token + def index events = Event.includes(:track, :event_type, event_users: :user) diff --git a/app/controllers/api/v1/rooms_controller.rb b/app/controllers/api/v1/rooms_controller.rb index 3046d51f..ecc959fa 100644 --- a/app/controllers/api/v1/rooms_controller.rb +++ b/app/controllers/api/v1/rooms_controller.rb @@ -4,6 +4,9 @@ module Api load_resource :conference, find_by: :short_title respond_to :json + # Disable forgery protection for any json requests. This is required for jsonp support + skip_before_action :verify_authenticity_token + def index if @conference respond_with @conference.venue ? @conference.venue.rooms : Room.none, callback: params[:callback] diff --git a/app/controllers/api/v1/speakers_controller.rb b/app/controllers/api/v1/speakers_controller.rb index cbdb4379..2706d2e9 100644 --- a/app/controllers/api/v1/speakers_controller.rb +++ b/app/controllers/api/v1/speakers_controller.rb @@ -4,6 +4,9 @@ module Api load_resource :conference, find_by: :short_title respond_to :json + # Disable forgery protection for any json requests. This is required for jsonp support + skip_before_action :verify_authenticity_token + def index if @conference users = User.joins(event_users: { event: { program: :conference} }) diff --git a/app/controllers/api/v1/tracks_controller.rb b/app/controllers/api/v1/tracks_controller.rb index a2033867..48a9450f 100644 --- a/app/controllers/api/v1/tracks_controller.rb +++ b/app/controllers/api/v1/tracks_controller.rb @@ -4,6 +4,9 @@ module Api load_resource :conference, find_by: :short_title respond_to :json + # Disable forgery protection for any json requests. This is required for jsonp support + skip_before_action :verify_authenticity_token + def index tracks = @conference ? @conference.program.tracks : Track.all