From 5fdd8b5bb11c1b972c07084c494caf5dc0b9df9b Mon Sep 17 00:00:00 2001 From: Andres Date: Wed, 19 Jul 2023 22:49:20 +0200 Subject: [PATCH] fix cookie reset on logout --- src/modules/auth/auth.controller.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 7499a86..5e09abb 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -161,7 +161,13 @@ export class AuthController { if (!accessToken) throw new UnauthorizedException() await this.commandBus.execute(new LogoutCommand(accessToken)) res.clearCookie('accessToken', { httpOnly: true, sameSite: 'none', secure: true }) - res.clearCookie('refreshToken', { httpOnly: true, sameSite: 'none', secure: true }) + + res.clearCookie('refreshToken', { + path: '/v1/auth/refresh-token', + httpOnly: true, + sameSite: 'none', + secure: true, + }) return null }