Disable Javascript CSRF protection on EnterprisesController#check_permalink route

This route checks if an enterprise permalink is taken or not. Allowing the route to be accessed via Javascript without strict CSRF protection is reasonable. Fixes the following errors:

ActionController::InvalidCrossOriginRequest: Security warning: an embedded <script> tag on another site requested protected JavaScript. If you know what you're doing, go ahead and disable forgery protection on this action to permit cross-origin JavaScript embedding.
This commit is contained in:
Matt-Yorkley
2020-09-14 14:13:15 +01:00
parent 3ebc8145df
commit f1002b953d

View File

@@ -6,6 +6,8 @@ class EnterprisesController < BaseController
include OrderCyclesHelper
include SerializerHelper
protect_from_forgery except: :check_permalink
# These prepended filters are in the reverse order of execution
prepend_before_action :set_order_cycles, :require_distributor_chosen, :reset_order, only: :shop