From 3b9fb2dd497534a28576cea14f6e51798685e2b2 Mon Sep 17 00:00:00 2001 From: blaxsior Date: Fri, 8 Dec 2023 17:08:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20clearCookie=EB=B6=80=EB=B6=84=EC=97=90?= =?UTF-8?q?=20=EC=BF=A0=ED=82=A4=20=EC=98=B5=EC=85=98=EC=9D=B4=20=EC=A7=80?= =?UTF-8?q?=EC=A0=95=EB=90=98=EC=96=B4=20=EC=9E=88=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/server/src/auth/auth.controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/server/src/auth/auth.controller.ts b/backend/server/src/auth/auth.controller.ts index b325102..8b55686 100644 --- a/backend/server/src/auth/auth.controller.ts +++ b/backend/server/src/auth/auth.controller.ts @@ -124,7 +124,11 @@ export class AuthController { return await this.authService.refresh(refresh_token); } catch (e) { // 토큰이 유효하지 않은 경우 -> 토큰을 삭제하고 에러 메시지 반환 - res.clearCookie(REFRESH_TOKEN_NAME); + res.clearCookie(REFRESH_TOKEN_NAME, { + httpOnly: true, + sameSite: 'none', + secure: true, + }); throw e; } }