BUG: Fixed IG Accounts without a Facebook account failing login due to 400 Bad Request #1752
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
File changed:
repositories/account.repository.js:19
Previously with the endpoint
/api/v1/accounts/login
Instagram accounts not associated with a Facebook account would receive this error:After looking at the network logs of Instagram I decided to try switching the endpoint to
/api/v1/web/accounts/login/ajax/
and that seemed to do the trick. Also tested that the new endpoint is compatible with Instagram accounts that have Facebook connections.EDIT: I added a commit to convert the 2FA function in the
account
repository to use the web API as well. Seems like there's some security check to make sure the login and 2fa requests come from the same platform. Also, if the user doesn't have a facebook account associated with their Instagram account, I don't think SMS will work here. I had to use an authenticator app to 2FA. Should we add this to the documentation?Question, for some reason the twoFactorLogin function hangs sometimes, but it still does a successful 2FA as my next login is trusted. Confused on why this happens and hoping we can get some clarity on why so this PR can be merged.^ Disregard, issue with my express route.