Sha256: 209aea22a7a7ba1e65a6a356cf840ec29f4e9485744656bead161b4909469ceb

Contents?: true

Size: 339 Bytes

Versions: 6

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

module ShopifyApp
  module CsrfProtection
    extend ActiveSupport::Concern
    included do
      include ShopifyApp::WithShopifyIdToken
      protect_from_forgery with: :exception, unless: :valid_session_token?
    end

    private

    def valid_session_token?
      jwt_payload.present?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shopify_app-22.5.2 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-22.5.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-22.5.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-22.4.0 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-22.3.1 lib/shopify_app/controller_concerns/csrf_protection.rb
shopify_app-22.3.0 lib/shopify_app/controller_concerns/csrf_protection.rb