I just created an account today w/ Robinhood and it has not been approved yet. This may be the cause of the error.
Code being executed:
var credentials = require("./config/robinhood.json");
var Robinhood = require('robinhood')(credentials, function(){
console.log(Robinhood.auth_token());
// <authenticated alphanumeric token>
});
Expected result
Expected result is to get the token, such as demonstrated in the example
Actual behaviour
Getting this error:
/var/www/git/Trading/workhorse/node_modules/robinhood/src/robinhood.js:149
_private.account = body.results[0].url;
^
TypeError: Cannot read property 'url' of undefined
at Request._callback (/var/www/git/Trading/workhorse/node_modules/robinhood/src/robinhood.js:149:45)
at Request.self.callback (/var/www/git/Trading/workhorse/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/var/www/git/Trading/workhorse/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/var/www/git/Trading/workhorse/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1047:12)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
and the data returned in the body parameter triggering the error above is
I just created an account today w/ Robinhood and it has not been approved yet. This may be the cause of the error.
Code being executed:
Expected result
Expected result is to get the token, such as demonstrated in the example
Actual behaviour
Getting this error:
and the data returned in the
body
parameter triggering the error above is