Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to link account (IgResponseError: POST /api/v1/accounts/read_msisdn_header/ - 302 Found) #30

Open
jakecoppinger opened this issue Nov 7, 2021 · 1 comment

Comments

@jakecoppinger
Copy link

I get this error when linking - is this a bug? I'm unable to link and the link ... ... message isn't marked as seen.

Installed via matrix-docker-ansible-deploy. list and help in the room with the bot works fine.

Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.057 [bot-sdk-Appservice] info: Processing transaction 157
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.058 [bot-sdk-Appservice] info: Processing event of type m.room.message
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: 172.18.0.9 - - [07/Nov/2021:07:49:39 +0000] "PUT /transactions/157?access_token=... HTTP/1.1" 200 2 "-" "Synapse/1.46.0"
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.066 [BotProvisioner] info: Got message to process with arg=link
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:40.076 [MatrixEventHandler] error: Error handling appservice room.event IgResponseError: POST /api/v1/accounts/read_msisdn_header/ - 302 Found;
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]:     at Request.handleResponseError (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:125:16)
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]:     at Request.send (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:53:28)
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]:     at async AccountRepository.readMsisdnHeader (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/repositories/account.repository.js:237:26)
@kumitterer
Copy link

There is an issue about this at dilame/instagram-private-api#1417 - as proposed there, simply commenting all occurrences of preLoginFlow() fixed this for me and the bridge now seems to be working just fine.

Specifically, I commented these lines:

await igc.simulate.preLoginFlow();

await this.ig.simulate.preLoginFlow();

await igc.simulate.preLoginFlow();

A better solution might be a try-catch around these function calls, although using preLoginFlow() doesn't seem to be necessary at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants