Skip to content

Commit

Permalink
feat(api): redirect on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jul 3, 2024
1 parent 8818bf6 commit 4d42269
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/routes/auth/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ module.exports.get = fastify => ({
path: '/',
sameSite: 'Strict',
secure: false,
}).send('The token has been revoked.');
});
res.header('Content-Type', 'text/html');
return res.send(`
<!DOCTYPE html>
<html>
<head><meta http-equiv="refresh" content="0; url='/'"></head>
<body></body>
</html>
`);
},
onRequest: [fastify.authenticate],
});

0 comments on commit 4d42269

Please sign in to comment.