Sha256: ab6ab7fe9d3958406e660f307937fd7dcd2842e894f26220b5e3ea8faf4562c4

Contents?: true

Size: 480 Bytes

Versions: 5

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module ShopifyApp
  module EnsureAuthenticatedLinks
    extend ActiveSupport::Concern

    included do
      before_action :redirect_to_splash_page, if: :missing_expected_jwt?
    end

    private

    def redirect_to_splash_page
      splash_page_path = root_path(return_to: request.fullpath, shop: current_shopify_domain)
      redirect_to(splash_page_path)
    end

    def missing_expected_jwt?
      jwt_shopify_domain.blank?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shopify_app-17.0.3 app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
shopify_app-17.0.2 app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
shopify_app-17.0.1 app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
shopify_app-17.0.0 app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
shopify_app-16.1.0 app/controllers/concerns/shopify_app/ensure_authenticated_links.rb