Open
Description
Hi,
Some parameters are optional, as per the API doc but lib breaks if not provided.
This is specific of the typeScript lib, doesn't happen on node-client. It comes from the formData builder.
How to reproduce:
call
exchangeRefreshTokenForAccessToken('refreshToken', 'clientId', 'clientSecret')
Expected Result:
Request should be sent.
It should work with only those parameters, particularly, scope
is optional. see doc: https://fusionauth.io/docs/v1/tech/oauth/endpoints#request-parameters-7
Actual result:
Type error at ligne
because scope
isn't provided
TypeError: Cannot read property 'name' of undefined
at FormData._getContentDisposition (/PATH/node_modules/@fusionauth/typescript-client/node_modules/form-data/lib/form_data.js:226:40)
at FormData._multiPartHeader (/PATH/node_modules/@fusionauth/typescript-client/node_modules/form-data/lib/form_data.js:177:33)
at FormData.append (/PATH/node_modules/@fusionauth/typescript-client/node_modules/form-data/lib/form_data.js:70:21)
at FusionAuthClient.exchangeRefreshTokenForAccessToken (/PATH/node_modules/@fusionauth/typescript-client/build/src/FusionAuthClient.js:795:14)
Note:
Works on the node-client:
https://github.com/FusionAuth/fusionauth-node-client/blob/3a36b95c04eb8e103967ca49c6548e6c4fdc0ef8/lib/FusionAuthClient.js#L928
Cheers