Skip to content

Extract csrftoken #1824

@alexjohnyoung

Description

@alexjohnyoung

General Question

Form

Put an [x] if you meet the condition, else leave [ ].

Question

Hi there. Firstly thanks for creating this awesome wrapper!

I used this library a while back, and did not run into really any issues. However after using it recently I cannot seem to login without having to complete a challenge. I have tried using the built in challenge repository without much success.

Now I'm trying to create a quick resolver for this purpose. Unfortunately the csrftoken appears unavailable from ig.state.cookieCsrfToken and it is only returning 'missing', both before and after attempting to login.

I'm wondering if anyone else has ran into this or how they solved the challenge problem? (FYI trying to keep this as far away from another challenge question)

Thanks

Code

const ig = new IgApiClient();
ig.state.generateDevice(username);
await ig.simulate.preLoginFlow();
console.log(ig.state.cookieCsrfToken); -> 'missing'
const loginResponse = await ig.account.login(username, password);
console.log(ig.state.cookieCsrfToken); -> 'missing'

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionunconfirmedThis issue hasn't been read/confirmed/accepted by an admin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions