}
public void updateConnection(Connection<?> connection) {
ConnectionData data = connection.createData();
SocialUser socialUser = socialUserRepository.findByUserAndProviderIdAndProviderUserId(user, data.getProviderId(), data.getProviderUserId());
if(socialUser != null){
socialUser.setDisplayName(data.getDisplayName());
socialUser.setProfileUrl(data.getProfileUrl());
socialUser.setImageUrl(data.getImageUrl());
socialUser.setAccessToken(encrypt(data.getAccessToken()));
socialUser.setSecret(encrypt(data.getSecret()));
socialUser.setRefreshToken(encrypt(data.getRefreshToken()));
socialUser.setExpireTime(data.getExpireTime());
socialUser = socialUserRepository.save(socialUser);
}
}