Sha256: 1e67abda5af0563f837c8f5f3f5cc8ffc882edfae84c231006b7ae04d38f6291
Contents?: true
Size: 771 Bytes
Versions: 47
Compression:
Stored size: 771 Bytes
Contents
# frozen_string_literal: true module ShopifyApp # rubocop:disable Style/ClassVars # Class var repo is needed here in order to share data between the 2 child classes. class InMemorySessionStore class EnvironmentError < StandardError; end def self.retrieve(id) repo[id] end def self.store(session, *_args) id = SecureRandom.uuid repo[id] = session id end def self.clear @@repo = nil end def self.repo if Rails.env.production? raise EnvironmentError, "Cannot use InMemorySessionStore in a Production environment. \ Please initialize ShopifyApp with a model that can store and retrieve sessions" end @@repo ||= {} end end # rubocop:enable Style/ClassVars end
Version data entries
47 entries across 47 versions & 2 rubygems