customValidation(springSocialSecurityProfile, errors);
if (errors.hasErrors()) return null;
if (!signUpService.isUserIdAvailable(userName)) {
errors.addError(new FieldError("signUpForm", "userName",
"Sorry, the username '" + userName + "' is not available"));
return null;
}
try
{
signUpService.signUpUserAndCompleteConnection(
springSocialSecurityProfile, request);
return springSocialSecurityProfile.getUserName();
}
catch (UsernameAlreadyExistsException e)
{
errors.addError(new FieldError("signUpForm", "userName",
"Sorry, the username '" + userName + "' is not available"));
return null;
}
}