From 966e249029ebe104487dd251a9ffbe7af9ccf281 Mon Sep 17 00:00:00 2001 From: bjarneo Date: Fri, 26 Apr 2024 09:02:34 +0200 Subject: [PATCH] fix: pass the entire sacred cookie settings on clear --- server/controllers/authentication.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/controllers/authentication.js b/server/controllers/authentication.js index bfda4a88..d6a6af1a 100644 --- a/server/controllers/authentication.js +++ b/server/controllers/authentication.js @@ -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',