From a88f8ab33e9e5b9240619b759f594cdc9512d60d Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 3 Aug 2026 15:56:48 +0900 Subject: [PATCH] =?UTF-8?q?[st]=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/st/app/api/auth/logout/route.ts | 10 ++++++++++ apps/st/src/entities/auth/api/auth-service.ts | 1 + 2 files changed, 11 insertions(+) create mode 100644 apps/st/app/api/auth/logout/route.ts diff --git a/apps/st/app/api/auth/logout/route.ts b/apps/st/app/api/auth/logout/route.ts new file mode 100644 index 000000000..caf486af2 --- /dev/null +++ b/apps/st/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/st/src/entities/auth/api/auth-service.ts b/apps/st/src/entities/auth/api/auth-service.ts index 0c3725d22..1573ac297 100644 --- a/apps/st/src/entities/auth/api/auth-service.ts +++ b/apps/st/src/entities/auth/api/auth-service.ts @@ -99,6 +99,7 @@ async function silentRefresh(): Promise { } export async function logout(): Promise { + await fetch("/api/auth/logout", { method: "POST" }); tokenManager.clearAuthToken(); clearDeviceId();