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 (