Class: ShopifyApp::SessionsController

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

Instance Method Summary collapse

Methods included from LoginProtection

#login_again_if_different_shop, #shop_session, #shopify_session

Instance Method Details

#callbackObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/shopify_app/sessions_controller.rb', line 17

def callback
  if auth_hash
    
    install_webhooks
    install_scripttags
    perform_after_authenticate_job

    redirect_to return_address
  else
    flash[:error] = I18n.t('could_not_log_in')
    redirect_to 
  end
end

#createObject



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

def create
  authenticate
end

#destroyObject



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

def destroy
  reset_session
  flash[:notice] = I18n.t('.logged_out')
  redirect_to 
end

#newObject



9
10
11
# File 'app/controllers/shopify_app/sessions_controller.rb', line 9

def new
  authenticate if sanitized_shop_name.present?
end