Skip to content

Commit

Permalink
fix: try to remove the httponly cookie by setting it as expired (#298)
Browse files Browse the repository at this point in the history
The issue do not occur in dev mode, which makes it hard to debug.
  • Loading branch information
bjarneo authored Apr 26, 2024
1 parent 3af848b commit 3e2ca81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/controllers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ async function authentication(fastify) {
);

fastify.post('/signout', async (_, reply) => {
reply.clearCookie(COOKIE_KEY_PUBLIC, { path: '/' }).clearCookie(COOKIE_KEY, { path: '/' });
reply.clearCookie(COOKIE_KEY_PUBLIC, { path: '/' });

// clear the http only cookie by setting an expired date
reply.setCookie(COOKIE_KEY, '', { path: '/', expires: new Date(0) });

return {
signout: 'ok',
Expand Down

0 comments on commit 3e2ca81

Please sign in to comment.