if (logger.isDebugEnabled() && customer != null) {
logger.debug("Customer found by username " + userName);
}
}
if (customer != null) {
ApplicationEvent lastPublishedEvent = (ApplicationEvent) request.getAttribute(LAST_PUBLISHED_EVENT_SESSION_ATTRIBUTED_NAME, WebRequest.SCOPE_REQUEST);
if (authentication instanceof RememberMeAuthenticationToken) {
// set transient property of customer
customer.setCookied(true);
boolean publishRememberMeEvent = true;
if (lastPublishedEvent != null && lastPublishedEvent instanceof CustomerAuthenticatedFromCookieEvent) {