CurrencyCloud / currencycloud-js

MIT License
20 stars 26 forks source link

nodejs package - Authorisation Through demoapi not working because query-string not form #3

Closed Gwillink closed 6 years ago

Gwillink commented 7 years ago

in the currency-cloud package for nodejs, in the lib => "client.js" file. There is an issue on calling "requestToken" function since 22.11.2017 about 3pm CET. The issue is as marked in the following: Note* : only in DEMO environment.

Seems like there is an issue with "qs", i tried with "form" and it worked

var requestToken = function() {
  var promise = rp.post({
    uri: config.baseUrl + config.authUrl,
   qs: {
      login_id: config.loginId,
      api_key: config.apiKey
    }
  })
  .then(function(res) {
    token = JSON.parse(res).auth_token;

    return token;
  });
  return promise;
};
ermi-ltd commented 6 years ago

This issue is now present on live. The suggested fix above (changing from qs to form) is working for us too.

ermi-ltd commented 6 years ago

Updating to package version 0.10.0 resolved this issue.

EAddario commented 6 years ago

As per comment above, this was addressed in v0.10.0