Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (principal instanceof UserDetails)
{
String email = ((UserDetails) principal).getUsername();
User loginUser = userService.findUserByEmail(email);
return new SecurityUser(loginUser);
}
return null;
}