package org.broadleafcommerce.security;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.broadleafcommerce.profile.domain.Customer;
import org.broadleafcommerce.profile.service.CustomerService;
import org.springframework.security.Authentication;
import org.springframework.stereotype.Service;

@Service("customerStateStore")
public class CustomerStateStore implements PostLoginObserver {

    @Resource
    private CustomerService customerService;

    public void processPostLogin(HttpServletRequest request, HttpServletResponse response, Authentication authResult) {
        Customer customer = customerService.readCustomerByUsername((String) authResult.getPrincipal());
        CustomerState.setCustomer(customer, request);
    }

    public void setCustomerService(CustomerService customerService) {
        this.customerService = customerService;
    }
}

@@ -841,137 +841,8 @@
   %7D%0D
-%0A%0D%0A    public void setCustomerService(CustomerService customerService) %7B%0D%0A        this.customerService = customerService;%0D%0A    %7D%0D
 %0A%7D%0D%0A

add pre logout observer