From 5e3d263750afb85e0fae38212875ecf7722feadc Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 3 Aug 2026 15:40:48 +0900 Subject: [PATCH] =?UTF-8?q?[cs]=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/cs/app/api/auth/logout/route.ts | 10 ++++++++++ apps/cs/src/entities/auth/api/auth-service.ts | 1 + 2 files changed, 11 insertions(+) create mode 100644 apps/cs/app/api/auth/logout/route.ts diff --git a/apps/cs/app/api/auth/logout/route.ts b/apps/cs/app/api/auth/logout/route.ts new file mode 100644 index 000000000..3e53a0705 --- /dev/null +++ b/apps/cs/app/api/auth/logout/route.ts @@ -0,0 +1,10 @@ +import { cookies } from "next/headers"; +import { NextResponse } from "next/server"; + +import { COOKIE_DOMAIN, REFRESH_TOKEN } from "@/shared/config"; + +export async function POST() { + const cookieStore = await cookies(); + cookieStore.delete({ name: REFRESH_TOKEN, domain: COOKIE_DOMAIN }); + return NextResponse.json({ message: "Logged out" }, { status: 200 }); +} diff --git a/apps/cs/src/entities/auth/api/auth-service.ts b/apps/cs/src/entities/auth/api/auth-service.ts index ce148e37d..70ee7091f 100644 --- a/apps/cs/src/entities/auth/api/auth-service.ts +++ b/apps/cs/src/entities/auth/api/auth-service.ts @@ -92,6 +92,7 @@ async function silentRefresh(): Promise { } async function logout(): Promise { + await fetch("/api/auth/logout", { method: "POST" }); tokenManager.clearAuthToken(); clearDeviceId();