Skip to content

Commit

Permalink
fix: actually revoke the token
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jan 21, 2024
1 parent 73c30c8 commit 3e7127a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/routes/auth/logout.js
Expand Up @@ -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',
});
Expand Down

0 comments on commit 3e7127a

Please sign in to comment.