I know that there is a very similar question like this one on StackOverflow, but i do not understand what the answer means, and because of that i am asking this question.
here's my code
const tokens = JSON.parse(fs.readFileSync("./tokens.json"));
const { accessToken, accessSecret, oauth_verifier } = tokens;
const client = new TwitterApi({
appKey: process.env.API_KEY,
appSecret: process.env.API_KEY_SECRET,
accessToken: accessToken,
accessSecret: accessSecret
});
const {client: Bot} = await client.login(oauth_verifier);
running this throws a 401 error with data saying Request token missing: ''.
i believe the problem lies in the oauth_verifier, as the code runs fine, and i have checked all my other credentials. I can also run a console.log()
without running into errors if the last line in my code block above is commented.