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
#callback ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 22
def callback
if auth_hash
login_shop
install_webhooks
install_scripttags
perform_after_authenticate_job
redirect_to return_address
else
flash[:error] = I18n.t('could_not_log_in')
redirect_to login_url
end
end
|
#create ⇒ Object
13
14
15
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 13
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
17
18
19
20
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 17
def enable_cookies
@shop = sanitized_shop_name
render_invalid_shop_error unless @shop
end
|
#new ⇒ Object
9
10
11
|
# File 'app/controllers/shopify_app/sessions_controller.rb', line 9
def new
authenticate if sanitized_shop_name.present?
end
|