Closed Gillinghammer closed 5 years ago
I have the same issue. Robinhood must've updated. So, I downloaded Algotrader thinking it would resolve issue however I'm still having the same issue after npm'ing latest. Also, I don't understand how to use getMFA() if I decided to use it....
@trapadulli
So this is kinda hacky but I got things working by editing the file at node_modules/algotrader/objects/broker/robinhood/Instrument.js
Edit the request to include an Authorization Header like so.
Now when you call instrument.getQuote() you must pass in your authenticated user like: instrument.getQuote(user).
getQuote(user) {
const _this = this;
return new Promise((resolve, reject) => {
request(
{
uri: _this.urls.quote,
headers: {
Authorization: 'Bearer ' + user.getAuthToken()
})
....
@Ladinn Pretty hacky like I said, but let me know if you'd like me to do a pull request for this.
@Gillinghammer thanks! I look forward to trying this tonight.
@Gillinghammer Thanks for figuring this out!
I just updated the readme, docs, and Instrument class' getQuote and populate methods to reflect the change. After testing without errors this issue is resolved.
@Ladinn _preAuth rejects body: "Unable to log in with provided credentials."... but my User object has a token. Why?
@trapadulli can you post the version you're using, the full error, and the code that causes the error?
@trapadulli can you post the version you're using, the full error, and the code that causes the error? on algotrader@1.4.3 I can't get past authenticate
user.authenticate() .then(() => { console.log("never gets here............") }) .catch(error => { console.log(error) })
Error: "Unable to log in with provided credentials."
Running into an issue that happened recently, so I am wondering if something changed in the Robinhood API.