From 719ac3cf0f64cabe52d10db85d586f6933560e66 Mon Sep 17 00:00:00 2001 From: Andres Date: Wed, 19 Jul 2023 22:45:39 +0200 Subject: [PATCH] fix cookie reset on logout --- src/modules/auth/auth.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index cb94a32..7499a86 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -160,8 +160,8 @@ export class AuthController { ): Promise { if (!accessToken) throw new UnauthorizedException() await this.commandBus.execute(new LogoutCommand(accessToken)) - res.clearCookie('accessToken') - res.clearCookie('refreshToken') + res.clearCookie('accessToken', { httpOnly: true, sameSite: 'none', secure: true }) + res.clearCookie('refreshToken', { httpOnly: true, sameSite: 'none', secure: true }) return null }