Module: ShopifyApp::LoginProtection
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/shopify_app/login_protection.rb
Instance Method Summary collapse
Instance Method Details
#shop_session ⇒ Object
23 24 25 |
# File 'lib/shopify_app/login_protection.rb', line 23 def shop_session session[:shopify] end |
#shopify_session ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/shopify_app/login_protection.rb', line 8 def shopify_session if session[:shopify] begin # session[:shopify] set in LoginController#finalize ShopifyAPI::Base.activate_session(session[:shopify]) yield ensure ShopifyAPI::Base.clear_session end else session[:return_to] = request.fullpath redirect_to login_path end end |