From 8420a22e67cbf70658155a5e72b6445df142ca12 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Tue, 27 Oct 2026 12:16:14 +0900 Subject: [PATCH] =?UTF-8?q?261027=5F01=5FENH:=20=EA=B3=B5=EC=9C=A0=20?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20=EC=82=AC=EC=9A=A9=EC=9E=90=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=EC=A0=91=EA=B7=BC=20=EC=8B=9C=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=ED=9B=84=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agent/references/repository-rules.md | 2 +- src/components/app-shell/AppMainLayout.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.agent/references/repository-rules.md b/.agent/references/repository-rules.md index b070004..3dac7bf 100644 --- a/.agent/references/repository-rules.md +++ b/.agent/references/repository-rules.md @@ -16,7 +16,7 @@ - Basic routes are /, /login, /logout and project pages without query parameters (/Report/Current, /Report/Quota, /Report/Tabulation, /Report/Crosstab, /Management/Derived, /Management/Exim). The selected project {projectType, pkey} lives in the user-scoped persistent atom `useSelectedProject` (localStorage, like legacy ptokenState); home, login and logout clear it. Address parameters never select a project: old `?projectType=0|1&pkey=rawKey` links are ignored, and sharing is only through generated Page Copy/URL Copy links. This is not access control; server project scope is authoritative. Preserve pkey case and use projectType+pkey in query keys and BFF paths, with current user id/role/team in query keys. Runtime-validate data, use existing UI components, retain raw server count/LOI semantics and display-only padded date cleanup. Keep loading/error/empty/retry states. - Basic progress uses type/loi/day/screen; date filters affect type/loi/screen, never day, matching the server. Logging is a best-effort /log/visit call with server cookie identity, no /log/site HTTP. - The second migration phase is closed. Until the user explicitly announces launch, this application is unlaunched and old External token compatibility is unnecessary. The user performs every operation that writes to the shared database (live login, bookmark/derived saves, imports, share issuance and External login) and live Excel generation checks. No shared DB calls in local validation. Phase closure does not certify unexecuted live checks. -- ReportMember/URL Copy/Page Copy roles are 9001/9002/9003. External login replaces the prior identity; validate the server-returned user and link together. Keep the link's project and page scope, disable project-list/summary reads, and use the link title. Page Copy has no GNB menus; URL Copy has only the four report menus. Hide logo navigation, Logout, project selection, Copy and bookmark writes. Bookmark reads and aggregate/Quota Excel remain allowed; server scope enforcement is authoritative. +- ReportMember/URL Copy/Page Copy roles are 9001/9002/9003. External login replaces the prior identity; validate the server-returned user and link together. Keep the link's project and page scope, disable project-list/summary reads, and use the link title. Page Copy has no GNB menus; URL Copy has only the four report menus. Hide logo navigation, Logout, project selection, Copy and bookmark writes. Bookmark reads and aggregate/Quota Excel remain allowed; server scope enforcement is authoritative. Like legacy Main (isAdmin > 8 → Logout), an External user opening / goes to /logout and then /login; other out-of-scope paths return to the link's realUrl. - Export/Import APIs intentionally have no ordinary-user role restriction. Their menu restriction (userRole === 1001 || userTeam === "R701") is temporary UX policy. Do not ask the server to add a role restriction; External access remains blocked by its interceptor. ## KART report streaming UI diff --git a/src/components/app-shell/AppMainLayout.tsx b/src/components/app-shell/AppMainLayout.tsx index c0146ac..ecfa0d0 100644 --- a/src/components/app-shell/AppMainLayout.tsx +++ b/src/components/app-shell/AppMainLayout.tsx @@ -19,9 +19,11 @@ export function AppMainLayout({ children }: { children: ReactNode }) { const externalAllowed = !external || (!!auth.external && externalPageAllowed(auth.external, pathname)); useEffect(() => { if (hydrated && !auth.user) router.replace("/logout"); + // Legacy Main sends shared-link users (isAdmin > 8) to Logout, ending the External session. + else if (hydrated && external && pathname === "/") router.replace("/logout"); else if (hydrated && !externalAllowed) router.replace((auth.external ? reportUrl(auth.external.realUrl) : "/logout") as Route); - }, [hydrated, auth.user, auth.external, externalAllowed, router]); + }, [hydrated, auth.user, auth.external, external, externalAllowed, pathname, router]); const hasSidebar = sideMenus.length > 0; if (!hydrated || !auth.user || !externalAllowed) return (