sasjs / adapter

An adapter for bidirectional SAS® <-> Javascript communication
https://adapter.sasjs.io
MIT License
39 stars 3 forks source link

fix(refreshTokensForViya): fixed FormData logic #804

Closed YuryShkoda closed 1 year ago

YuryShkoda commented 1 year ago

Issue

Because typeof FormData is function for node and browser environments, it is right to compare it to undefined.

Intent

Fix sending form data to /SASLogon/oauth/token endpoint in order to refresh access token.

Implementation

isNode utility is used to check if the environment is node to use a correct instance of FormData from form-data package.

Checks

No PR (that involves a non-trivial code change) should be merged, unless all items below are confirmed! If an urgent fix is needed - use a tar file.