Sha256: 75228ec3dcd39e4c5d081f910106bb75cbb2eb69654b5cc63a95bf0deaa8f9ce

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

# You should replace InMemorySessionStore with what you will be using
# in Production. For example a model called "Shop":
#
# ShopifySessionRepository.storage = 'Shop'
#
# Interface to implement are self.retrieve(id) and self.store(ShopifyAPI::Session)
# Here is how you would add these functions to an ActiveRecord:
#
# class Shop < ActiveRecord::Base
#   def self.store(session)
#     shop = Shop.new(domain: session.url, token: session.token)
#     shop.save!
#     shop.id
#   end
#
#   def self.retrieve(id)
#     if shop = Shop.where(id: id).first
#       ShopifyAPI::Session.new(shop.domain, shop.token)
#     end
#   end
# end

ShopifySessionRepository.storage = InMemorySessionStore

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify_app-5.0.2 lib/generators/shopify_app/templates/config/initializers/shopify_session_repository.rb