threadsjs / threads.js

A Node.js library for the Threads API
MIT License
279 stars 29 forks source link

Login credentials / 2FA #78

Closed sleep9 closed 3 months ago

sleep9 commented 11 months ago

How to utilize 2FA / checkpoint challenge code for login? Does not seem to be documented. I have an app implementing this library but is being rejected due to login rejections from Instagram. I am looking for a way one can authorize the login via instagram for my third party client.

elijah-wright commented 11 months ago

do you have 2FA on your account? the console should prompt you to put in your code.

sleep9 commented 11 months ago

It doesnt prompt. I removed the following dependency const { fetch } = require("undici"); for regular fetch library so that it would work on react-native. Could that be the source of the lack of 2fa in my build?

elijah-wright commented 11 months ago

interesting, I'm also working with the Instagram API with React Native (but not using threads.js). are you getting any login requests?

sleep9 commented 11 months ago

What do you mean by login requests. If I try to login I get a failed login and a prompt in instagram telling me their was a login attempt. Only if I flag "this was me" will any subsequent logins from my app work. If 2FA is on what is supposed to occur?

elijah-wright commented 10 months ago

ah ok, this makes more sense now. if what's making the request to Instagram has a different IP than what your home network is, you'll get that popup. so, for example, if I have an Express "proxy" server running on Vercel's servers and I try to make a request, it'll go through Vercel's servers and you'll have to do the login attempt thing. there's really nothing I can do about this unfortunately but I can try and see if there's some way to use a preexisting device to make that request back telling Instagram that IP is ok

elijah-wright commented 3 months ago

no longer applicable in v2