Sha256: b0416b4bcf50d780cb8785451f4e894d956863ce6d1d28fe2ff5886827c6115b
Contents?: true
Size: 737 Bytes
Versions: 26
Compression:
Stored size: 737 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 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 ::ShopifyApp::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
26 entries across 26 versions & 1 rubygems