Open Nuruddin999 opened 3 years ago
Same problem
same
Did you solve this?
I'm having the same issue here... Any idea? 🤷♂️
const username = conf.get<string>(EnvVariables.INSTAGRAM_USERNAME)
const password = conf.get<string>(EnvVariables.INSTAGRAM_PASSWORD)
if (!username || !password) {
throw new Error('Instagram username and password must be provided')
}
const ig = new IgApiClient()
ig.state.generateDevice(username)
/**
* Login flow
*/
await ig.simulate.preLoginFlow()
await ig.account.login(username, password).catch(async (error) => {
await ig.account
.twoFactorLogin({
username,
verificationCode: await inquirer
.prompt({ type: 'input', name: 'code', message: 'Enter 2FA code' })
.then((a) => a.code),
twoFactorIdentifier: error.response.body.two_factor_info.two_factor_identifier,
trustThisDevice: '1',
verificationMethod: '1',
})
})
await ig.simulate.postLoginFlow()
in get serveside props i run code
but sms dont come and i paste additional 8 number security code which instagram provides me when sms dont come and after that i have error Please check the security code and try again. How fix it ?