Sha256: 840579f3623694630481d043643d7546c985e222112dd5b04cbee3c526e5347e
Contents?: true
Size: 781 Bytes
Versions: 8
Compression:
Stored size: 781 Bytes
Contents
# frozen_string_literal: true module C class Front::Devise::SessionsController < Devise::SessionsController layout 'c/main_application' after_action :after_login, only: :create def after_login return unless session[:cart_id].present? begin customer = current_front_customer_account.customer cart = C::Cart.find(session[:cart_id]) cart.update(customer_id: customer.id) cart.order.update(customer: customer) if cart.order.present? rescue ActiveRecord::RecordNotFound # Do nothing, as there is nothing to set end end def after_sign_in_path_for(resource) request[:checkout] ? new_checkout_path : super end def after_sign_out_path_for(_resource_or_scope) '/' end end end
Version data entries
8 entries across 8 versions & 1 rubygems