Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
]);
// Code is an object, lets parse the content
code = code.code;
let sendCode = await ig.challenge.sendSecurityCode(code);
console.log(sendCode);
}).catch(Api.IgLoginRequiredError, () => {
if(hasCookies) {
console.log("Invalid cookies");
} else {
// This block is not supossed to be used never (IgLoginBadPasswordError) exists
console.log("Incorrect password");
return "incorrectPassword";
}
}).catch(Api.IgLoginBadPasswordError, () => {
console.log("Incorrect password");
return "incorrectPassword";
});
// If result is not undefined we send the ig object session
return result;
}