Sha256: e465dd3ddc065c18b200c7cd664d1b63644ccbb3ae52fe1d90483bf1f78fc84a

Contents?: true

Size: 306 Bytes

Versions: 42

Compression:

Stored size: 306 Bytes

Contents

# frozen_string_literal: true
module ShopifyApp
  module CsrfProtection
    extend ActiveSupport::Concern
    included do
      protect_from_forgery with: :exception, unless: :valid_session_token?
    end

    private

    def valid_session_token?
      request.env['jwt.shopify_domain']
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
ruby_shopify_app-1.3.3 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.3.2 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.3.1 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.3.0 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.2.0 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.1.0 lib/ruby_shopify_app/controller_concerns/csrf_protection.rb
ruby_shopify_app-1.0.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.1.3 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.1.2 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.1.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.1.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.0.4 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.0.3 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.0.2 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.0.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-18.0.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-17.2.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-17.2.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-17.1.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-17.1.0 lib/shopify_app/controller_concerns/csrf_protection.rb