Sha256: 52d12b65e2d5b6e8f7a5eefec545c1fb2df1778d749a5ece83edeef09661c7a4
Contents?: true
Size: 517 Bytes
Versions: 11
Compression:
Stored size: 517 Bytes
Contents
# frozen_string_literal: true # 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
11 entries across 11 versions & 1 rubygems