Closed trapadulli closed 5 years ago
is this project abandoned?
fixed it good enough. updated authenticate:
authenticate() {
const _this = this;
return new Promise((resolve, reject) => {
request.post({
uri: _this.url + "/oauth2/token/",
form: {
username: _this.username,
password: _this.password,
client_id: 'c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS',
grant_type: "password",
scope: "internal"
}
}, (error, response, body) => {
if (error) reject(error);
else if (response.statusCode !== 200) reject(new LibraryError(body));
else {
_this.token = JSON.parse(body).access_token;
//console.log(_this.url)
_this.getAccount().then(account => {
//console.log(account)
_this.account = account.account_number;
_this.password = _this.password;
resolve(_this);
}).catch(error => reject(error));
}
})
})
}
...and updated header authenticate in relevant methods:
headers: { 'Authorization': 'Bearer ' + _this.token }
Thanks! I don't think this project is updated frequently. Hey may take a few [more] weeks to merge your PR
Thanks @trapadulli for providing this! Sorry for the delay in the update, but this has been updated in 1.4.0 and along with a few other features.
has auth broken? I haven't looked into it I was just made aware all my trades are failing.
this is the error message:
node:64416) UnhandledPromiseRejectionWarning: Error:
Not Found
The requested URL /api-token-auth/ was not found on this server.
thanks