I was using this library to integrate with Twitch OAuth, and I ran into an issue where the Twitch Token API response was non standard and I had no way to debug the response body (the response.body property was already read and could not be cloned). This PR attaches the parsed body to the response object for easier debugging.
BTW for anyone else that comes across this error integrating Twitch OAuth, the fix was to include the clientId and clientSecret in the body of the token request (again, another non standard thing the twitch API is asking for):
strategy.code.getToken('some-url-here?code=code-value-here&scope=', {
requestOptions: {
body: {
// twitch doesn't seem to support RFC6749..., so add the client_id and client_secret to the body
client_id: "value-here",
client_secret: "value-here",
}
}
});
I was using this library to integrate with Twitch OAuth, and I ran into an issue where the Twitch Token API response was non standard and I had no way to debug the response body (the response.body property was already read and could not be cloned). This PR attaches the parsed body to the response object for easier debugging.
BTW for anyone else that comes across this error integrating Twitch OAuth, the fix was to include the
clientId
andclientSecret
in the body of the token request (again, another non standard thing the twitch API is asking for):