[as] feat: 로그아웃 라우트 핸들러 적용

This commit is contained in:
2026-08-03 14:57:47 +09:00
parent 25287dc3d9
commit 70136aa65d
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -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 });
}
@@ -76,6 +76,7 @@ async function silentRefresh(): Promise<void> {
}
async function logout(): Promise<void> {
await fetch("/api/auth/logout", { method: "POST" });
tokenManager.clearAuthToken();
clearDeviceId();