From 6c022cd1ec8594c4072838df97f0761bb1df9a15 Mon Sep 17 00:00:00 2001 From: swcho Date: Tue, 23 Sep 2025 11:35:18 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=84=B8=EC=85=98=20=EB=A7=8C=EB=A3=8C=EC=8B=9C=20CM=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=A1=9C=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=ED=8A=B8=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20(env=20=ED=8C=8C=EC=9D=BC=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=9E=AC=EC=84=A4=EC=A0=95=20=ED=95=84?= =?UTF-8?q?=EC=9A=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/.env.local | 3 +++ apps/sn/src/entities/auth/lib/auth-wrapper.tsx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/sn/.env.local b/apps/sn/.env.local index 9d5804fc0..ed1b605c3 100644 --- a/apps/sn/.env.local +++ b/apps/sn/.env.local @@ -11,6 +11,9 @@ NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_ NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083 NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com +NEXT_PUBLIC_DEV_CM_LOGIN_PAGE_URL = http://localhost:3000/auth/login +NEXT_PUBLIC_VDI_DEV_CM_LOGIN_PAGE_URL = http://localhost:3000/auth/login +NEXT_PUBLIC_VDI_DEV_CM_LOGIN_PAGE_URL = http://localhost:3000/auth/login #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883 #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.222:8883 #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883 \ No newline at end of file diff --git a/apps/sn/src/entities/auth/lib/auth-wrapper.tsx b/apps/sn/src/entities/auth/lib/auth-wrapper.tsx index f0710e249..cfe908e2a 100644 --- a/apps/sn/src/entities/auth/lib/auth-wrapper.tsx +++ b/apps/sn/src/entities/auth/lib/auth-wrapper.tsx @@ -10,6 +10,7 @@ import { getCookie } from "@/shared/lib"; import { LoginApi } from "../api/login-service"; const CLAIM_NAME = process.env.NEXT_PUBLIC_CLAIM_NAME || "Authorization"; +const LOGIN_PAGE_URL = process.env.NEXT_PUBLIC_DEV_CM_LOGIN_PAGE_URL; // 개발 환경 URL const AuthWrapper = ({ children }: { children: React.ReactNode }) => { const router = useRouter(); @@ -40,7 +41,10 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => { } catch (refreshError) { console.error("Token refresh failed:", refreshError); setUserInfo(null); - router.push("/"); + // router.push("/"); // 개발시 홈으로 돌아가기 + + window.location.href = LOGIN_PAGE_URL; // 세션 만료 시 CM 로그인 페이지로 리다이렉트 + // router.push는 같은 Next.js 앱 내에서만 작동하므로 다른 앱으로 이동할 때는 window.location.href 사용 } } })();