Here is the code I'm using, but I keep getting a 403 error in response.
let username = "CLIENT_ID_GOES_HERE";
let password = "SECRET_GOES_HERE";
let basicAuth = Buffer.from(`${username}:${password}`).toString('base64');
try {
response = await axios.delete(`https://github.com/applications/${clientId}/grant`,
{
headers: {
'Authorization': `Basic ${basicAuth}`,
'Accept': 'application/vnd.github.v3+json',
},
data: {
access_token: token
}
});
} catch (e) {
return {
statusCode: 502,
body: JSON.stringify(e)
}
}
I've verified that the client ID, secret and token are all correct. The token I'm using is the one that is returned by github upon authenticating.