Module: ShopifyApp::SessionsConcern

Extended by:
ActiveSupport::Concern
Included in:
SessionsController
Defined in:
lib/shopify_app/sessions_concern.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/shopify_app/sessions_concern.rb', line 18

def callback
  if auth_hash
    
    install_webhooks
    install_scripttags

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

#createObject



14
15
16
# File 'lib/shopify_app/sessions_concern.rb', line 14

def create
  authenticate
end

#destroyObject



32
33
34
35
36
37
# File 'lib/shopify_app/sessions_concern.rb', line 32

def destroy
  session[:shopify] = nil
  session[:shopify_domain] = nil
  flash[:notice] = I18n.t('.logged_out')
  redirect_to 
end

#newObject



10
11
12
# File 'lib/shopify_app/sessions_concern.rb', line 10

def new
  authenticate if sanitized_shop_name.present?
end