Do not verify authenticity token for JSON requests
This commit is contained in:
parent
59f205cf3e
commit
ee431d86d1
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
skip_before_action :verify_authenticity_token, if: :json_request?
|
||||
|
||||
private
|
||||
|
||||
def json_request?
|
||||
request.format.json?
|
||||
end
|
||||
end
|
||||
|
|
Reference in a new issue