Class: ShopifyApp::SessionsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ShopifyApp::SessionsController
show all
- Includes:
- LoginProtection
- Defined in:
- app/controllers/shopify_app/sessions_controller.rb
Instance Method Summary
collapse
#login_again_if_different_shop, #shop_session, #shopify_session
Instance Method Details
#create ⇒ Object
14
15
16
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 14
def create
authenticate
end
|
#destroy ⇒ Object
36
37
38
39
40
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 36
def destroy
reset_session
flash[:notice] = I18n.t('.logged_out')
redirect_to login_url
end
|
#enable_cookies ⇒ Object
18
19
20
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 18
def enable_cookies
validate_shop
end
|
#granted_storage_access ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 27
def granted_storage_access
return unless validate_shop
session['shopify.granted_storage_access'] = true
params = { shop: @shop }
redirect_to "#{ShopifyApp.configuration.root_url}?#{params.to_query}"
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 10
def new
authenticate if sanitized_shop_name.present?
end
|
#top_level_interaction ⇒ Object
22
23
24
25
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 22
def top_level_interaction
@url = login_url(top_level: true)
validate_shop
end
|