Skip to content

Commit

Permalink
fix: pass the entire sacred cookie settings on clear
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Apr 26, 2024
1 parent 3e2ca81 commit 966e249
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/controllers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@ async function authentication(fastify) {
);

fastify.post('/signout', async (_, reply) => {
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) });
reply
.clearCookie(COOKIE_KEY_PUBLIC, { path: '/' })
.clearCookie(COOKIE_KEY, '', SACRED_COOKIE_SETTINGS);

return {
signout: 'ok',
Expand Down

0 comments on commit 966e249

Please sign in to comment.