mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Remote forgery protection for json requests to the api/v1 endpoints
Due to my testing, I incorrectly removed the forgery protection skip action from the controllers in the api. This fixes that and allows jsonp calls to work correctly
This commit is contained in:
parent
70e0f42bbb
commit
de4563ddb1
5 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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} })
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue