fix: actually revoke the token

This commit is contained in:
Isaac 2024-01-21 01:54:01 +00:00
parent 73c30c84bd
commit 3e7127a3d9
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -5,7 +5,11 @@ module.exports.get = fastify => ({
const { accessToken } = req.user;
await fetch('https://discord.com/api/oauth2/token/revoke', {
body: new URLSearchParams({ token: accessToken }).toString(),
body: new URLSearchParams({
client_id: req.routeOptions.config.client.user.id,
client_secret: process.env.DISCORD_SECRET,
token: accessToken,
}).toString(),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
method: 'POST',
});