From 49c2a8b4fbf2de119bb6f42a99e0d83ff95a6be0 Mon Sep 17 00:00:00 2001 From: Ivan Skvorcov Date: Sat, 13 Apr 2024 20:04:05 +0300 Subject: [PATCH] Delete cookie after log out --- src/presentation/http/router/auth.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/presentation/http/router/auth.ts b/src/presentation/http/router/auth.ts index 21afca4e..5ad705d3 100644 --- a/src/presentation/http/router/auth.ts +++ b/src/presentation/http/router/auth.ts @@ -146,6 +146,10 @@ const AuthRouter: FastifyPluginCallback = (fastify, opts, don await opts.authService.removeSessionByRefreshToken(request.body.token); return reply + .clearCookie('refreshToken', { + path: '/auth', + domain: opts.cookieDomain, + }) .status(StatusCodes.OK) .send({ ok: true,