Class: ShopifyApp::SessionsController

Inherits:
ActionController::Base
  • Object
show all
Includes:
LoginProtection, RedirectForEmbedded
Defined in:
app/controllers/shopify_app/sessions_controller.rb

Constant Summary

Constants included from LoginProtection

LoginProtection::ACCESS_TOKEN_REQUIRED_HEADER

Instance Method Summary collapse

Methods included from RedirectForEmbedded

add_app_bridge_redirect_url_header

Methods included from LoginProtection

#activate_shopify_session, #add_top_level_redirection_headers, #current_shopify_session, #login_again_if_different_user_or_shop, #signal_access_token_required

Instance Method Details

#createObject



18
19
20
# File 'app/controllers/shopify_app/sessions_controller.rb', line 18

def create
  authenticate
end

#destroyObject



31
32
33
34
35
36
37
# File 'app/controllers/shopify_app/sessions_controller.rb', line 31

def destroy
  reset_session
  flash[:notice] = I18n.t(".logged_out")
  ShopifyApp::Logger.debug("Session destroyed")
  ShopifyApp::Logger.debug("Redirecting to #{}")
  redirect_to()
end

#newObject



14
15
16
# File 'app/controllers/shopify_app/sessions_controller.rb', line 14

def new
  authenticate if sanitized_shop_name.present?
end

#patch_shopify_id_tokenObject



22
23
24
# File 'app/controllers/shopify_app/sessions_controller.rb', line 22

def patch_shopify_id_token
  render(layout: "shopify_app/layouts/app_bridge")
end

#top_level_interactionObject



26
27
28
29
# File 'app/controllers/shopify_app/sessions_controller.rb', line 26

def top_level_interaction
  @url = (top_level: true)
  validate_shop_presence
end