jlobos / instagram-web-api

🤳 Instagram Private Web API client for Node
https://npmjs.com/instagram-web-api
MIT License
1.12k stars 186 forks source link

Update challange outside the app #99

Open frexiz opened 5 years ago

frexiz commented 5 years ago

Hello I have little problem with Instagram challanges. When a new user tries to login it gets challange. I m chosing the option for SMS verification and I'm returning the challange url to my frontend. After that I sent the chalange url and the sms code to my nodejs backend. It gives me success response but next time I have another checkpoint ?

Example code

if (error.error && error.error.message === 'checkpoint_required') { let challengeUrl = error.error.checkpoint_url; client.updateChallenge({challengeUrl, choice: 0}).then((state) => { res.json({ 'verification': true, 'challangeurl': challengeUrl, 'msg': 'Sms has been sent to the user' }); }); // 0 is sms verification }

` app.post('/challange-resolve', function (req, res) {

const cookieStore = new FileCookieStore('./cookies/' + req.body.username + '.json');

const client = new Instagram({username: req.body.username, password: req.body.password, cookieStore});

const challengeUrl = req.body.challangeUrl;

client.updateChallenge({challengeUrl, securityCode: req.body.code}).then((state) => {
    console.log(state);
})

}); `

MonsieurBibo commented 3 years ago

Are you still dealing with this problem ? I would just like to remind you that challenges arise when the user logs in from an unusual location or if Instagram thinks the user is using a malicious third party service.

luanmnz commented 3 years ago

Are you still dealing with this problem ? I would just like to remind you that challenges arise when the user logs in from an unusual location or if Instagram thinks the user is using a malicious third party service.

I'm dealing with this same problem.