From a5095f0ac2a37b50ca347e01c8b8b59841aca497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CKangShinGyu=E2=80=9D?= <“rkdtlseb@naver.com”> Date: Wed, 14 Oct 2026 12:55:55 +0900 Subject: [PATCH] =?UTF-8?q?fix(logout):=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=95=88=EB=90=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/home/(with-header)/my-info/page.tsx | 6 ++---- src/app/home/_components/HomeHeader.tsx | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/home/(with-header)/my-info/page.tsx b/src/app/home/(with-header)/my-info/page.tsx index 0a665028..5362cc22 100644 --- a/src/app/home/(with-header)/my-info/page.tsx +++ b/src/app/home/(with-header)/my-info/page.tsx @@ -3,7 +3,6 @@ import { LoadingIndicator } from "@/components/loading/LoadingIndicator"; import Link from "next/link"; -import { useRouter } from "next/navigation"; import { ArrowLeft, ChevronRight } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; @@ -34,7 +33,6 @@ function providerLabel(provider: string): string { } export default function MyInfoPage() { - const router = useRouter(); const queryClient = useQueryClient(); const { data: user, isLoading, isFetching, refetch } = useSessionUser(); @@ -56,7 +54,7 @@ export default function MyInfoPage() { return; } tearDownClientSession({ queryClient }); - router.replace("/"); + window.location.replace("/"); } async function handleWithdrawConfirm() { @@ -68,7 +66,7 @@ export default function MyInfoPage() { clearExpenseCurrencyPreferencesForUser(user?.id); tearDownClientSession({ queryClient }); queryClient.clear(); - router.replace("/"); + window.location.replace("/"); return; } if (result.kind === "host_delegation_required") { diff --git a/src/app/home/_components/HomeHeader.tsx b/src/app/home/_components/HomeHeader.tsx index b5fc7cdd..e3224725 100644 --- a/src/app/home/_components/HomeHeader.tsx +++ b/src/app/home/_components/HomeHeader.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import { usePathname, useRouter } from "next/navigation"; +import { usePathname } from "next/navigation"; import Image from "next/image"; import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; @@ -17,7 +17,6 @@ import { useSessionUser } from "@/hooks/useSessionUser"; import { tearDownClientSession } from "@/lib/client-storage"; export function HomeHeader() { - const router = useRouter(); const pathname = usePathname(); const queryClient = useQueryClient(); const [open, setOpen] = useState(false); @@ -46,7 +45,8 @@ export function HomeHeader() { return; } tearDownClientSession({ queryClient }); - router.replace("/"); + // 로그인 중 prefetch된 `/`(→ `/home` 리다이렉트)를 재사용하지 않도록 문서 이동으로 라우터 캐시를 비운다. + window.location.replace("/"); }; return (