//Calls ProviderSignInUtils.handlePostSignUp() after a successful registration
public String processRegister(RegisterCustomerForm registerCustomerForm, BindingResult errors,
HttpServletRequest request, HttpServletResponse response, Model model)
throws ServiceException, PricingException {
if (isUseEmailForLogin()) {
Customer customer = registerCustomerForm.getCustomer();
customer.setUsername(customer.getEmailAddress());
}
registerCustomerValidator.validate(registerCustomerForm, errors, isUseEmailForLogin());
if (!errors.hasErrors()) {
Customer newCustomer = customerService.registerCustomer(registerCustomerForm.getCustomer(),
registerCustomerForm.getPassword(), registerCustomerForm.getPasswordConfirm());
assert(newCustomer != null);
ProviderSignInUtils.handlePostSignUp(newCustomer.getUsername(), new ServletWebRequest(request));
// The next line needs to use the customer from the input form and not the customer returned after registration
// so that we still have the unencoded password for use by the authentication mechanism.
loginService.loginCustomer(registerCustomerForm.getCustomer());
// Need to ensure that the Cart on CartState is owned by the newly registered customer.
Order cart = CartState.getCart();
if (cart != null && !(cart instanceof NullOrderImpl) && cart.getEmailAddress() == null) {
cart.setEmailAddress(newCustomer.getEmailAddress());
orderService.save(cart, false);
}
String redirectUrl = registerCustomerForm.getRedirectUrl();
if (StringUtils.isNotBlank(redirectUrl) && redirectUrl.contains(":")) {