Hi,
Based on the readme of this gem/plugin
it suggested to create a model and assign it into ShopifySessionRepository.storage right
the model could be something like this
class Shop < ActiveRecord::Basedef 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
hmm I have changed it to follow the readme, one thing tho, so first time shop install/login into the app, it will create record for it into the Shop model right, and if the same shop re-login again, supposedly it uses the one that in the record instead of create the new record.
So if the same shop login 5 times, it will create 5 records, I think this is wrong..