Closed
Description
Sorry, but your new implementation (version 2) do not work as intended.
- Optional parameters (like
scope
) are declared indata
even if not set.
The calloauth.clientCredentials(axios, 'https://example.com', 'foo', 'bar')()
sendgrant_type=client_credentials&client_id=foo&client_secret=bar&scope=
to the API. - The parameters of the function returned by your first function do not end up correctly in
data
.
The calloauth.clientCredentials(axios, 'https://example.com', 'foo', 'bar')('baz')
send0=b&1=a&2=z&grant_type=client_credentials&client_id=foo&client_secret=bar&scope=
to the API.