Sha256: 403011c8591977810be91c740181dd816047e370627b2e123d761d2c02597280

Contents?: true

Size: 443 Bytes

Versions: 1

Compression:

Stored size: 443 Bytes

Contents

module ShopifyApp::LoginProtection
  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
  
  def shop_session
    session[:shopify]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify_app-4.0.0 lib/shopify_app/login_protection.rb