Sha256: 2a9f80f7e93e676ecd12e4a049b953148107863bba68d657e8c68ed3e0ba0d88
Contents?: true
Size: 772 Bytes
Versions: 9
Compression:
Stored size: 772 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
9 entries across 9 versions & 1 rubygems