From b514bdc4723bdb0f423dcf7f96056a5767c413a6 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 3 Aug 2026 14:53:42 +0900 Subject: [PATCH] =?UTF-8?q?[cm]=20feat:=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EB=9D=BC=EC=9A=B0=ED=8A=B8=20=ED=95=B8=EB=93=A4?= =?UTF-8?q?=EB=9F=AC=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cm/app/api/auth/logout/route.ts | 12 ++---------- apps/cm/src/entities/auth/api/auth-service.ts | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/cm/app/api/auth/logout/route.ts b/apps/cm/app/api/auth/logout/route.ts index fdcc9df7c..ce7ec7a1f 100644 --- a/apps/cm/app/api/auth/logout/route.ts +++ b/apps/cm/app/api/auth/logout/route.ts @@ -1,17 +1,9 @@ import { cookies } from "next/headers"; import { NextResponse } from "next/server"; -import { - ACCESS_TOKEN, - AUTH_USER_ID, - CLAIM_NAME, - REFRESH_TOKEN, -} from "@/shared/config"; +import { COOKIE_DOMAIN, REFRESH_TOKEN } from "@/shared/config"; export async function POST() { const cookieStore = await cookies(); - cookieStore.delete(ACCESS_TOKEN); - cookieStore.delete(REFRESH_TOKEN); - cookieStore.delete(AUTH_USER_ID); - cookieStore.delete(CLAIM_NAME); + cookieStore.delete({ name: REFRESH_TOKEN, domain: COOKIE_DOMAIN }); return NextResponse.json({ message: "Logged out" }, { status: 200 }); } diff --git a/apps/cm/src/entities/auth/api/auth-service.ts b/apps/cm/src/entities/auth/api/auth-service.ts index 79d99c1e8..b047524ca 100644 --- a/apps/cm/src/entities/auth/api/auth-service.ts +++ b/apps/cm/src/entities/auth/api/auth-service.ts @@ -89,6 +89,7 @@ async function silentRefresh(): Promise { } async function logout(): Promise { + await fetch("/api/auth/logout", { method: "POST" }); tokenManager.clearAuthToken(); clearDeviceId();