private UserDTO createDTO(UserDetails principal) {
UserDTO dto = null;
if (principal != null) {
String username = principal.getUsername();
SecurityRole role = getRole(principal.getAuthorities());
dto = new UserDTO(username, role);
}
LOGGER.debug("Created user dto: {}", dto);