Getting 400 error when trying to refresh a token (client secret missing)

Thanks for the headsup @BarryCarlyon! That was the reason.

A cleaner - and WORKING - approach:

var params = new URLSearchParams();
params.append('grant_type', 'refresh_token');
params.append('refresh_token', encodeURIComponent("RefreshTokenDeliveredFromGamesCallLandsHere")); //I am not finally sure if the encode is still required here but it works with it.
params.append('client_id', "mYcLiEnTiD");
params.append('client_secret', "sEcReThErE");
axios.post('https://id.twitch.tv/oauth2/token', params, { responseType: 'json' }).then([...]
1 Like