API V1 skip authenticity token validation (#18142)

* Skip authenticity token on API V1

* Test execution experiment - should fail

* Fix specs test

* Remove listings v1 controller before_action hook
This commit is contained in:
Fernando Valverde 2022-07-20 07:51:33 -06:00 committed by GitHub
parent 41f4d6d393
commit 0d942e6161
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -6,6 +6,8 @@ module Api
self.api_action = true
skip_before_action :verify_authenticity_token
rescue_from ActionController::ParameterMissing do |exc|
error_unprocessable_entity(exc.message)
end

View file

@ -8,7 +8,6 @@ module Api
before_action :authenticate!
before_action :set_cache_control_headers, only: %i[index show]
before_action :set_and_authorize_listing, only: %i[update]
skip_before_action :verify_authenticity_token, only: %i[create update]
end
end
end