Sha256: d755f8732b022c2957dfd267bd28e5f387f072d80eb6b69c1ec5f1193f86fccd
Contents?: true
Size: 881 Bytes
Versions: 20
Compression:
Stored size: 881 Bytes
Contents
# frozen_string_literal: true module ShopifyApp module ShopAccessScopesVerification extend ActiveSupport::Concern include ShopifyApp::RedirectForEmbedded included do before_action :login_on_scope_changes end protected def login_on_scope_changes if scopes_mismatch? if embedded_param? redirect_for_embedded else redirect_to(shop_login) end end end private def scopes_mismatch? ShopifyApp.configuration.shop_access_scopes_strategy.update_access_scopes?(current_shopify_domain) end def current_shopify_domain return if params[:shop].blank? ShopifyApp::Utils.sanitize_shop_domain(params[:shop]) end def shop_login ShopifyApp::Utils.shop_login_url(shop: params[:shop], host: params[:host], return_to: request.fullpath) end end end
Version data entries
20 entries across 20 versions & 1 rubygems