Sha256: 0b1128965c9b6c89445f80e68bda405dcd6265467f3b8d9d5f924ba1509167b7

Contents?: true

Size: 580 Bytes

Versions: 35

Compression:

Stored size: 580 Bytes

Contents

module ShopifyApp
  class InMemorySessionStore
    class EnvironmentError < StandardError; end

    def self.retrieve(id)
      repo[id]
    end

    def self.store(session)
      id = SecureRandom.uuid
      repo[id] = session
      id
    end

    def self.clear
      @@repo = nil
    end

    def self.repo
      if Rails.env.production?
        raise EnvironmentError.new("Cannot use InMemorySessionStore in a Production environment. \
          Please initialize ShopifyApp with a model that can store and retrieve sessions")
      end
      @@repo ||= {}
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
shopify_app-11.6.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.5.1 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.4.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.3.2 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.3.1 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.3.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.2.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.1.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.0.2 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.0.1 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-11.0.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-10.0.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-9.0.4 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-9.0.3 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-9.0.2 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-9.0.1 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-9.0.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-8.6.1 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-8.6.0 lib/shopify_app/session/in_memory_session_store.rb
shopify_app-8.5.1 lib/shopify_app/session/in_memory_session_store.rb