Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (user) {
await addOAuthIdToUserProfile(user, 'google', userData.id);
}
else {
const id = await AccountsServer.createUser({
username: userData.emails[0].value,
email: userData.emails[0].value,
profile: {
name: userData.name.givenName + ' ' + userData.name.familyName,
avatar: userData.image.url,
oauth: {
google: userData.id,
}
}
});
user = await AccountsServer.findUserById(id);
}
return user;
},
},