Sha256: 8740e9f87a0c4a6abc5014a683dfb721b97e14b19c2e261f7dd5c4352e144608
Contents?: true
Size: 483 Bytes
Versions: 17
Compression:
Stored size: 483 Bytes
Contents
# Merges users orders to their account after sign in and sign up. Warden::Manager.after_set_user except: :fetch do |user, auth, opts| if auth.cookies.signed[:guest_token].present? if user.is_a?(Spree::User) Spree::Order.incomplete.where(guest_token: auth.cookies.signed[:guest_token], user_id: nil).each do |order| order.associate_user!(user) end end end end Warden::Manager.before_logout do |user, auth, opts| auth.cookies.delete :guest_token end
Version data entries
17 entries across 17 versions & 3 rubygems