From 4bcef0fff1b34165304a0d8763db6bc9b3c3f21b Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 15 Oct 2025 13:37:13 +0900 Subject: [PATCH] =?UTF-8?q?fix,=20remove:=20-=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=EB=A5=BC=20=EC=B5=9C=EC=B4=88=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EC=8B=9C=EB=A7=8C=EC=9D=B4=20=EC=95=84=EB=8B=88?= =?UTF-8?q?=EB=9D=BC=20pathname=20=EB=B3=80=EA=B2=BD=EC=8B=9C=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD.=20-=20hostname=20=EB=A1=9C=EA=B7=B8=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/src/entities/auth/lib/auth-wrapper.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/sn/src/entities/auth/lib/auth-wrapper.tsx b/apps/sn/src/entities/auth/lib/auth-wrapper.tsx index c42866c9b..289a97087 100644 --- a/apps/sn/src/entities/auth/lib/auth-wrapper.tsx +++ b/apps/sn/src/entities/auth/lib/auth-wrapper.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect } from "react"; -import { useRouter } from "next/navigation"; +import { useRouter, usePathname } from "next/navigation"; import { client } from "@/shared/api"; import type { IUserInfo } from "@/shared/store"; import { useUserStore } from "@/shared/lib"; @@ -14,6 +14,7 @@ const LOGIN_PAGE_URL = process.env.NEXT_PUBLIC_CM_LOGIN_PAGE_URL || "http://dev. const AuthWrapper = ({ children }: { children: React.ReactNode }) => { const router = useRouter(); + const pathname = usePathname(); const { userInfo, setUserInfo } = useUserStore((state) => state); async function authCheck() { @@ -43,7 +44,6 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => { setUserInfo(null); const hostname = window.location.hostname; - console.log("Current hostname:", hostname); // 개발 환경에서는 localhost 도메인 사용 if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "con.mind-one.co.kr") @@ -55,7 +55,7 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => { } } })(); - }, []); + }, [pathname]); return <>{children}; };