throw new RuntimeException("Couldn't register new oauth user");
}
user = userDao.get(res);
user.setType(Type.oauth);
user.setDomainId(serverId);
userDao.update(user, null);
} else { // just change password
// check user type before changing password, it must be match oauthServerId
if (user.getDomainId() == null || serverId != user.getDomainId()) {
log.error("User already registered! with different OAuth server");
return;