Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
klenotiw committed Nov 15, 2022
1 parent fd87247 commit 8d6547c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/shopify_app/controller_concerns/ensure_billing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def has_active_payment?(session)
end

def has_subscription?(session)
ShopifyApp::Logger.debug("Checking if has subscription")
ShopifyApp::Logger.debug("Checking if shop has subscription")
response = run_query(session: session, query: RECURRING_PURCHASES_QUERY)
subscriptions = response.body["data"]["currentAppInstallation"]["activeSubscriptions"]

Expand Down
5 changes: 2 additions & 3 deletions lib/shopify_app/controller_concerns/login_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module LoginProtection
ACCESS_TOKEN_REQUIRED_HEADER = "X-Shopify-API-Request-Failure-Unauthorized"

def activate_shopify_session
ShopifyApp::Logger.debug("Activating Shopify session")

if current_shopify_session.blank?
signal_access_token_required
ShopifyApp::Logger.debug("No session found, redirecting to login")
Expand All @@ -32,6 +30,7 @@ def activate_shopify_session
end

begin
ShopifyApp::Logger.debug("Activating Shopify session")
ShopifyAPI::Context.activate_session(current_shopify_session)
yield
ensure
Expand All @@ -49,7 +48,7 @@ def current_shopify_session
is_online: online_token_configured?,
)
rescue ShopifyAPI::Errors::CookieNotFoundError
ShopifyApp::Logger.info("CookiesNotFound for current Shopify session")
ShopifyApp::Logger.info("No cookies have been found - cookie name: #{cookie_name}")
nil
rescue ShopifyAPI::Errors::InvalidJwtTokenError
ShopifyApp::Logger.info("Invalid JWT token for current Shopify session")
Expand Down

0 comments on commit 8d6547c

Please sign in to comment.