customer.setLastname(auth.getLastname());
if(StringUtils.isNotEmpty(auth.getGender())){
customer.setGender(auth.getGender());
}
CustomerAttribute attribute = new CustomerAttribute();
AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
attribute.setAttributeDefinition(attributeDefinition);
String screenName = "";
if(StringUtils.isNotEmpty(auth.getLastname())){
if(StringUtils.isNotEmpty(auth.getLastname())){
screenName = auth.getLastname();
if(screenName.length() > 1){
screenName = screenName.substring(0, 1);
}
if(!screenName.endsWith(".")){
screenName = screenName + ". ";
}
}
}
screenName = screenName + auth.getFirstname();
attribute.setShortStringValue(screenName);
customer.getAttributes().add(attribute);
if(StringUtils.isNotEmpty(auth.getLanguage())){
customer.setDefaultLocale(auth.getLanguage());
}