How to use the instagram-private-api.IgCheckpointError function in instagram-private-api

To help you get started, we’ve selected a few instagram-private-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linkfy / Tools-for-Instagram / src / login.js View on Github external
} catch (e){
            console.log(e);
            console.log("Login failed from cookie | Remove incorrect cookie".red);
            return "removeCookie";
        };
        

        //Open DB
        const adapter = new FileSync("./db/"+(process.env.IG_USERNAME).toLowerCase()+".json");
        const db = low(adapter);
        db.defaults({likes: [], follows: []}).write()
        ig.shortid = shortid;
        ig.db = db;
        
        return ig;
    }).catch(Api.IgCheckpointError, async () => {

        console.log(ig.state.checkpoint);
        await ig.challenge.auto(true); //Sms it was me
        console.log(ig.state.checkpoint); //Challenge info here
        
        let code = await inquirer.prompt([
            {
                type: 'input',
                name: 'code',
                message: 'Enter code',
            },
        ]);

        // Code is an object, lets parse the content
        code = code.code;