Module: ShopifyApp::WithShopifyIdToken

Extended by:
ActiveSupport::Concern
Defined in:
lib/shopify_app/controller_concerns/with_shopify_id_token.rb

Instance Method Summary collapse

Instance Method Details

#jwt_expire_atObject



19
20
21
22
23
24
# File 'lib/shopify_app/controller_concerns/with_shopify_id_token.rb', line 19

def jwt_expire_at
  expire_at = request.env["jwt.expire_at"]
  return unless expire_at

  expire_at - 5.seconds # 5s gap to start fetching new token in advance
end

#jwt_shopify_domainObject



11
12
13
# File 'lib/shopify_app/controller_concerns/with_shopify_id_token.rb', line 11

def jwt_shopify_domain
  request.env["jwt.shopify_domain"]
end

#jwt_shopify_user_idObject



15
16
17
# File 'lib/shopify_app/controller_concerns/with_shopify_id_token.rb', line 15

def jwt_shopify_user_id
  request.env["jwt.shopify_user_id"]
end

#shopify_id_tokenObject



7
8
9
# File 'lib/shopify_app/controller_concerns/with_shopify_id_token.rb', line 7

def shopify_id_token
  @shopify_id_token ||= id_token_from_request_env || id_token_from_authorization_header || id_token_from_url_param
end