diff --git a/website/server/libs/auth/index.js b/website/server/libs/auth/index.js index 4d94278da9..7d7822dfd4 100644 --- a/website/server/libs/auth/index.js +++ b/website/server/libs/auth/index.js @@ -157,9 +157,9 @@ async function registerLocal (req, res, { isV3 = false }) { }; if (existingUser) { - let networks = common.constants.SUPPORTED_SOCIAL_NETWORKS; + const networks = common.constants.SUPPORTED_SOCIAL_NETWORKS; // need to insert FB here to allow users who only have FB auth to connect local auth. - networks.insert({ key: 'facebook', name: 'Facebook' }) + networks.push({ key: 'facebook', name: 'Facebook' }); const hasSocialAuth = networks.find(network => { if (existingUser.auth.hasOwnProperty(network.key)) { // eslint-disable-line no-prototype-builtins, max-len return existingUser.auth[network.key].id;