Skip to content

Commit 966e249

Browse files
committed
fix: pass the entire sacred cookie settings on clear
1 parent 3e2ca81 commit 966e249

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/controllers/authentication.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,9 @@ async function authentication(fastify) {
170170
);
171171

172172
fastify.post('/signout', async (_, reply) => {
173-
reply.clearCookie(COOKIE_KEY_PUBLIC, { path: '/' });
174-
175-
// clear the http only cookie by setting an expired date
176-
reply.setCookie(COOKIE_KEY, '', { path: '/', expires: new Date(0) });
173+
reply
174+
.clearCookie(COOKIE_KEY_PUBLIC, { path: '/' })
175+
.clearCookie(COOKIE_KEY, '', SACRED_COOKIE_SETTINGS);
177176

178177
return {
179178
signout: 'ok',

0 commit comments

Comments
 (0)