From 386fc61a3fd55a7e3d2becfa7877295a4e7ca836 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 13:39:43 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[cs]=20chore:=20route=20handler=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EA=B5=AC=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cs/app/api/proxy/[...url]/route.ts | 13 +------------ apps/cs/middleware.ts | 8 ++++---- apps/cs/next.config.ts | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/apps/cs/app/api/proxy/[...url]/route.ts b/apps/cs/app/api/proxy/[...url]/route.ts index 4385956d3..16185ba1d 100644 --- a/apps/cs/app/api/proxy/[...url]/route.ts +++ b/apps/cs/app/api/proxy/[...url]/route.ts @@ -70,7 +70,7 @@ async function handler( response.cookies.set(REFRESH_TOKEN, refreshToken, { httpOnly: true, sameSite: "strict", - domain: getCookieDomain(), + domain: COOKIE_DOMAIN, path: "/", }); } @@ -105,14 +105,3 @@ export async function PUT( const params = await props.params; return handler(request, params, "PUT"); } - -function getCookieDomain(): string | undefined { - if (typeof window === "undefined") return undefined; - - if (COOKIE_DOMAIN) return COOKIE_DOMAIN; - - const { hostname } = window.location; - if (hostname === "localhost" || hostname === "127.0.0.1") return undefined; - - return hostname; -} diff --git a/apps/cs/middleware.ts b/apps/cs/middleware.ts index 98b741325..adc6077b9 100644 --- a/apps/cs/middleware.ts +++ b/apps/cs/middleware.ts @@ -41,7 +41,7 @@ export function middleware(req: NextRequest) { logMessages.push(` Rewritten URL: ${newUrl}`); logMessages.push("\n--------------------------------\n"); - // console.log(logMessages.join("\n")); + console.log(logMessages.join("\n")); const response = NextResponse.rewrite(new URL(newUrl)); return addSecurityHeaders(response); @@ -58,7 +58,7 @@ export function middleware(req: NextRequest) { logMessages.push(` Rewritten URL: ${newUrl}`); logMessages.push("\n--------------------------------\n"); - // console.log(logMessages.join("\n")); + console.log(logMessages.join("\n")); const response = NextResponse.rewrite(new URL(newUrl), { headers: requestHeaders, @@ -83,7 +83,7 @@ export function middleware(req: NextRequest) { logMessages.push(` Link API Rewritten URL: ${newUrl}`); logMessages.push("\n--------------------------------\n"); - // console.log(logMessages.join("\n")); + console.log(logMessages.join("\n")); const response = NextResponse.rewrite(new URL(newUrl), { headers: requestHeaders, @@ -97,7 +97,7 @@ export function middleware(req: NextRequest) { } logMessages.push("\n--------------------------------\n"); - // console.log(logMessages.join("\n")); + console.log(logMessages.join("\n")); const response = NextResponse.next(); return addSecurityHeaders(response); diff --git a/apps/cs/next.config.ts b/apps/cs/next.config.ts index 61d7f72cc..827d37753 100644 --- a/apps/cs/next.config.ts +++ b/apps/cs/next.config.ts @@ -18,7 +18,7 @@ const nextConfig: NextConfig = { fetches: { fullUrl: true, }, - }, + }, async headers() { return [ { From 903cdaad45809cd6551c79d613c305db9449168c Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 13:41:15 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[as]=20chore:=20route=20handler=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EA=B5=AC=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/as/app/api/proxy/[...url]/route.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/as/app/api/proxy/[...url]/route.ts b/apps/as/app/api/proxy/[...url]/route.ts index b32008942..d54f08656 100644 --- a/apps/as/app/api/proxy/[...url]/route.ts +++ b/apps/as/app/api/proxy/[...url]/route.ts @@ -68,7 +68,7 @@ async function handler( cookieStore.set(REFRESH_TOKEN, refreshToken, { httpOnly: true, sameSite: "strict", - domain: getCookieDomain(), + domain: COOKIE_DOMAIN, path: "/", }); } @@ -92,14 +92,3 @@ export async function PUT(request: Request, props: { params: Promise<{ url: stri const params = await props.params; return handler(request, params, "PUT"); } - -function getCookieDomain(): string | undefined { - if (typeof window === "undefined") return undefined; - - if (COOKIE_DOMAIN) return COOKIE_DOMAIN; - - const { hostname } = window.location; - if (hostname === "localhost" || hostname === "127.0.0.1") return undefined; - - return hostname; -} From 3b2f5c2d5d1139cbbae3d6519d30d4eb56f69f80 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 13:42:55 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[cm]=20chore:=20route=20handler=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EA=B5=AC=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cm/app/api/proxy/[...url]/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/cm/app/api/proxy/[...url]/route.ts b/apps/cm/app/api/proxy/[...url]/route.ts index c0f646cd2..57cfc86e8 100644 --- a/apps/cm/app/api/proxy/[...url]/route.ts +++ b/apps/cm/app/api/proxy/[...url]/route.ts @@ -2,6 +2,7 @@ import { ACCESS_TOKEN, AUTH_USER_ID, CLAIM_NAME, + COOKIE_DOMAIN, REFRESH_TOKEN, SERVER_API_URL, SITE_ID, @@ -135,6 +136,7 @@ async function handler( cookieStore.set(REFRESH_TOKEN, refreshToken, { httpOnly: true, sameSite: "lax", + domain: COOKIE_DOMAIN, path: "/", }); } From 1d3910c1573b5fe1e1c894b2765a2058ed3e2b62 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 13:43:46 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[st]=20chore:=20route=20handler=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EA=B5=AC=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/st/app/api/proxy/[...url]/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/st/app/api/proxy/[...url]/route.ts b/apps/st/app/api/proxy/[...url]/route.ts index 261d6b259..8d2ce62dc 100644 --- a/apps/st/app/api/proxy/[...url]/route.ts +++ b/apps/st/app/api/proxy/[...url]/route.ts @@ -5,6 +5,7 @@ import { ACCESS_TOKEN, AUTH_USER_ID, CLAIM_NAME, + COOKIE_DOMAIN, REFRESH_TOKEN, SERVER_API_URL, SITE_ID, @@ -75,6 +76,7 @@ async function handler( cookieStore.set(REFRESH_TOKEN, refreshToken, { httpOnly: true, sameSite: "lax", + domain: COOKIE_DOMAIN, path: "/", }); } From 81fc947c9dac867ca03d9fbcc7baf65a517dc3e9 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 13:49:22 +0900 Subject: [PATCH 05/11] =?UTF-8?q?chore:=20as,=20st=20=EC=95=B1=20standalon?= =?UTF-8?q?e=20=ED=99=9C=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/as/next.config.ts | 1 + apps/st/next.config.ts | 74 +++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/apps/as/next.config.ts b/apps/as/next.config.ts index 8864de0e7..d3afd4d70 100644 --- a/apps/as/next.config.ts +++ b/apps/as/next.config.ts @@ -1,6 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { + output: "standalone", reactStrictMode: true, transpilePackages: ["@common/assets"], }; diff --git a/apps/st/next.config.ts b/apps/st/next.config.ts index a0adf6946..743a29bdd 100644 --- a/apps/st/next.config.ts +++ b/apps/st/next.config.ts @@ -1,47 +1,47 @@ import type { NextConfig } from "next"; const subDomain = - process.env.NEXT_PUBLIC_SUB_DOMAIN || "http://localhost:13000"; + process.env.NEXT_PUBLIC_SUB_DOMAIN || "http://localhost:13000"; const nextConfig: NextConfig = { - // output: "standalone", - async headers() { - return [ - { - source: "/(.*)", - headers: [ - { - key: "Content-Security-Policy", - value: "img-src 'self' data: https: blob:;", - }, - ], - }, - ]; - }, - async rewrites() { - return { - beforeFiles: [ - { - source: "/_next/static/:path*", - destination: `${subDomain}/_next/static/:path*`, - has: [ + output: "standalone", + async headers() { + return [ { - type: "header", - key: "referer", - value: "(.*)/cms(.*)", + source: "/(.*)", + headers: [ + { + key: "Content-Security-Policy", + value: "img-src 'self' data: https: blob:;", + }, + ], }, - ], - }, - ], - afterFiles: [ - { - source: "/cms/:path*", - destination: `${subDomain}/cms/:path*`, - }, - ], - fallback: [], - }; - }, + ]; + }, + async rewrites() { + return { + beforeFiles: [ + { + source: "/_next/static/:path*", + destination: `${subDomain}/_next/static/:path*`, + has: [ + { + type: "header", + key: "referer", + value: "(.*)/cms(.*)", + }, + ], + }, + ], + afterFiles: [ + { + source: "/cms/:path*", + destination: `${subDomain}/cms/:path*`, + }, + ], + fallback: [], + }; + }, }; export default nextConfig; From 2f0448a98e9a7b044069275b6184aba6f6068365 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 17:08:36 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[common/components]=20refactor:=20banner,?= =?UTF-8?q?=20menu,=20site=EB=A5=BC=20=EA=B8=B0=EB=B3=B8=20fetch=20?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/components/src/api/banner.ts | 36 +++++++++---------- packages/common/components/src/api/menu.ts | 32 +++++++++++------ packages/common/components/src/api/site.ts | 20 ++++------- .../common/components/src/ui/footer/index.tsx | 4 +-- .../common/components/src/ui/header/index.tsx | 2 +- .../common/components/src/ui/layout/nolnb.tsx | 24 ++++++------- .../common/components/src/ui/lnb/index.tsx | 2 +- pnpm-lock.yaml | 7 ++-- 8 files changed, 65 insertions(+), 62 deletions(-) diff --git a/packages/common/components/src/api/banner.ts b/packages/common/components/src/api/banner.ts index 8d9962529..3f72b46d5 100644 --- a/packages/common/components/src/api/banner.ts +++ b/packages/common/components/src/api/banner.ts @@ -1,28 +1,24 @@ -import { getApiClient } from "./client"; import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; export interface Banner { - bnrSn: number; - bnrTypeCd: string; - bnrTypeNm: string; - bnrTtl: string; - lnkgUrlAddr: string; - useYn: string; - atflCd: string; - mdfcnDt: string; - mdfr: string; - mdfrNm: string; - } + bnrSn: number; + bnrTypeCd: string; + bnrTypeNm: string; + bnrTtl: string; + lnkgUrlAddr: string; + useYn: string; + atflCd: string; + mdfcnDt: string; + mdfr: string; + mdfrNm: string; +} +const { PROXY_HOST } = getConfig(); +const BASE_URL = `${PROXY_HOST}/server`; - const { PROXY_HOST } = getConfig(); - const BASE_URL = `${PROXY_HOST}/server`; - -const client = getApiClient(); - -export const getBannerList = async (siteId: string) => { - const response = await client.get( +export const getBannerList = async (siteId: string): Promise => { + const response = await fetch( `${BASE_URL}${ENDPOINT.CMS_SERVICE.BANNERS}/${siteId}`, { method: "GET", @@ -31,5 +27,5 @@ export const getBannerList = async (siteId: string) => { }, }, ); - return response.data; + return response.json(); }; diff --git a/packages/common/components/src/api/menu.ts b/packages/common/components/src/api/menu.ts index b4d84c95e..f6ace73d3 100644 --- a/packages/common/components/src/api/menu.ts +++ b/packages/common/components/src/api/menu.ts @@ -1,4 +1,3 @@ -import { getApiClient } from "./client"; import { ENDPOINT } from "../config"; import { getConfig } from "@common/config"; @@ -27,22 +26,35 @@ export interface TreeMenu extends MenuItem { menuHlpCn: string; } -const client = getApiClient(); const { PROXY_HOST } = getConfig(); const BASE_URL = `${PROXY_HOST}/server`; -export const getMenuList = async (siteId: string) => { - const response = await client.get( - `${ENDPOINT.CMS_SERVICE.MENU_ROLES}/${siteId}`, +export const getMenuList = async (siteId: string): Promise => { + const response = await fetch( + `${BASE_URL}${ENDPOINT.CMS_SERVICE.MENU_ROLES}/${siteId}`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }, ); - return response.data; + return response.json(); }; -export const getPreviewTreeMenuList = async (siteId: string) => { - const response = await client.get( - `${ENDPOINT.CMS_SERVICE.MENUS}/${siteId}/tree/preview`, +export const getPreviewTreeMenuList = async ( + siteId: string, +): Promise => { + const response = await fetch( + `${BASE_URL}${ENDPOINT.CMS_SERVICE.MENUS}/${siteId}/tree/preview`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }, ); - return response.data; + return response.json(); }; export const getAnonymouseMenuList = async ( diff --git a/packages/common/components/src/api/site.ts b/packages/common/components/src/api/site.ts index bfe0f3275..6d6957dbc 100644 --- a/packages/common/components/src/api/site.ts +++ b/packages/common/components/src/api/site.ts @@ -1,4 +1,3 @@ -import { getApiClient } from "./client"; import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; @@ -70,17 +69,12 @@ export const getSiteInfo = async (siteId: string) => { return response.json() as Promise; }; -const client = getApiClient(); - -export const getSiteList = async () => { - const response = await client.get( - `${BASE_URL}${ENDPOINT.CMS_SERVICE.SITE_LIST}`, - { - method: "GET", - headers: { - "Content-Type": "application/json", - }, +export const getSiteList = async (): Promise => { + const response = await fetch(`${BASE_URL}${ENDPOINT.CMS_SERVICE.SITE_LIST}`, { + method: "GET", + headers: { + "Content-Type": "application/json", }, - ); - return response.data; + }); + return response.json(); }; diff --git a/packages/common/components/src/ui/footer/index.tsx b/packages/common/components/src/ui/footer/index.tsx index 2430820ff..4df6e170b 100644 --- a/packages/common/components/src/ui/footer/index.tsx +++ b/packages/common/components/src/ui/footer/index.tsx @@ -12,8 +12,6 @@ import { CarouselPrevious, } from "../carousel"; -const siteId = getCookie("site-id-key") ?? ""; - type BannerImageProps = { atflCd: string; bnrSn: number; @@ -64,6 +62,8 @@ const BannerImage = ({ atflCd, lnkgUrlAddr }: BannerImageProps) => { }; export function Footer() { + const siteId = getCookie("site-id-key") ?? ""; + const { data: siteInfo } = useQuery({ queryKey: [ENDPOINT.CMS_SERVICE.SITES, siteId], queryFn: () => getSiteInfo(siteId), diff --git a/packages/common/components/src/ui/header/index.tsx b/packages/common/components/src/ui/header/index.tsx index 99b7977cd..7d01f09f0 100644 --- a/packages/common/components/src/ui/header/index.tsx +++ b/packages/common/components/src/ui/header/index.tsx @@ -29,7 +29,6 @@ import { ScrollArea, ScrollBar } from "../scroll-area"; const appConfig = getConfig(); const userId = getCookie(appConfig.AUTH_USER_ID ?? ""); -const siteId = getCookie("site-id-key") ?? ""; const isLoggedIn = !!userId; function getRootDomain(hostname: string): string { @@ -144,6 +143,7 @@ export function Header({ const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const logoRef = useRef(null); const remainingMs = useTokenRemainingMs(mounted && isLoggedIn && !viewOnly); + const siteId = getCookie("site-id-key") ?? ""; useSessionExtendConfirm({ enabled: diff --git a/packages/common/components/src/ui/layout/nolnb.tsx b/packages/common/components/src/ui/layout/nolnb.tsx index 47717c99b..abc436e23 100644 --- a/packages/common/components/src/ui/layout/nolnb.tsx +++ b/packages/common/components/src/ui/layout/nolnb.tsx @@ -6,7 +6,6 @@ import { HelpDialogProvider } from "../../provider/help-dialog-context"; import { ClientIpGuard } from "../../lib/client-ip-guard"; import type { MenuItem } from "../../api"; import { SidebarProvider } from "../sidebar"; -import { LNB } from "../lnb"; import { Header } from "../header"; import { Footer } from "../footer"; import "./common.css"; @@ -17,7 +16,6 @@ export function NoLNBLayout({ authService, tokenManager, currentPath, - handleMenuClick, }: { children: React.ReactNode; queryClient?: QueryClient; @@ -33,19 +31,19 @@ export function NoLNBLayout({ -
-
-
-
-
{children}
-
+
+
+
+
+
{children}
+
+
-
- + diff --git a/packages/common/components/src/ui/lnb/index.tsx b/packages/common/components/src/ui/lnb/index.tsx index 1c7722a36..35d2f121d 100644 --- a/packages/common/components/src/ui/lnb/index.tsx +++ b/packages/common/components/src/ui/lnb/index.tsx @@ -42,7 +42,6 @@ import { const appConfig = getConfig(); const userId = getCookie(appConfig.AUTH_USER_ID ?? ""); -const appSiteId = getCookie("site-id-key") ?? ""; const isLoggedIn = !!userId; export function LNB({ @@ -74,6 +73,7 @@ export function LNB({ helpContent, } = useHelpDialog(); + const appSiteId = getCookie("site-id-key") ?? ""; const siteId = propSiteId ?? appSiteId; const { data: menuListData } = useQuery({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd99062b0..214b99a21 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -247,9 +247,9 @@ importers: '@common/components': specifier: workspace:* version: link:../../packages/common/components - '@common/config': + '@common/network': specifier: workspace:* - version: link:../../packages/common/config + version: link:../../packages/common/network '@dnd-kit/core': specifier: ^6.3.1 version: 6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -1042,6 +1042,9 @@ importers: js-cookie: specifier: ^3.0.5 version: 3.0.5 + lucide-react: + specifier: ^0.474.0 + version: 0.474.0(react@19.2.4) moment: specifier: ^2.30.1 version: 2.30.1 From 196d31a084c116bf2bce53eb5e86a876d54872bd Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 18:35:14 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[common/components]=20feat:=20raw=20fetch?= =?UTF-8?q?=20=ED=97=A4=EB=8D=94=EC=97=90=20=ED=86=A0=ED=81=B0=20=EC=A3=BC?= =?UTF-8?q?=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/components/src/api/banner.ts | 6 ++--- packages/common/components/src/api/menu.ts | 16 ++++++-------- packages/common/components/src/api/site.ts | 11 +++++----- .../common/components/src/lib/auth-header.ts | 22 +++++++++++++++++++ 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 packages/common/components/src/lib/auth-header.ts diff --git a/packages/common/components/src/api/banner.ts b/packages/common/components/src/api/banner.ts index 3f72b46d5..90cc6e0f5 100644 --- a/packages/common/components/src/api/banner.ts +++ b/packages/common/components/src/api/banner.ts @@ -1,5 +1,6 @@ import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; +import { getAuthHeaders } from "@/lib/auth-header"; export interface Banner { bnrSn: number; @@ -22,9 +23,8 @@ export const getBannerList = async (siteId: string): Promise => { `${BASE_URL}${ENDPOINT.CMS_SERVICE.BANNERS}/${siteId}`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }, ); return response.json(); diff --git a/packages/common/components/src/api/menu.ts b/packages/common/components/src/api/menu.ts index f6ace73d3..788118b98 100644 --- a/packages/common/components/src/api/menu.ts +++ b/packages/common/components/src/api/menu.ts @@ -1,3 +1,4 @@ +import { getAuthHeaders } from "@/lib/auth-header"; import { ENDPOINT } from "../config"; import { getConfig } from "@common/config"; @@ -34,9 +35,8 @@ export const getMenuList = async (siteId: string): Promise => { `${BASE_URL}${ENDPOINT.CMS_SERVICE.MENU_ROLES}/${siteId}`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }, ); return response.json(); @@ -49,9 +49,8 @@ export const getPreviewTreeMenuList = async ( `${BASE_URL}${ENDPOINT.CMS_SERVICE.MENUS}/${siteId}/tree/preview`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }, ); return response.json(); @@ -64,9 +63,8 @@ export const getAnonymouseMenuList = async ( `${BASE_URL}${ENDPOINT.CMS_SERVICE.MENU_ANONYMOUS}/user/${siteId}`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }, ); return response.json(); diff --git a/packages/common/components/src/api/site.ts b/packages/common/components/src/api/site.ts index 6d6957dbc..86038ee8a 100644 --- a/packages/common/components/src/api/site.ts +++ b/packages/common/components/src/api/site.ts @@ -1,5 +1,6 @@ import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; +import { getAuthHeaders } from "@/lib/auth-header"; export interface SiteInfo { siteId: string; @@ -61,9 +62,8 @@ export const getSiteInfo = async (siteId: string) => { `${BASE_URL}${ENDPOINT.CMS_SERVICE.SITES}/${siteId}`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }, ); return response.json() as Promise; @@ -72,9 +72,8 @@ export const getSiteInfo = async (siteId: string) => { export const getSiteList = async (): Promise => { const response = await fetch(`${BASE_URL}${ENDPOINT.CMS_SERVICE.SITE_LIST}`, { method: "GET", - headers: { - "Content-Type": "application/json", - }, + headers: getAuthHeaders(), + credentials: "include", }); return response.json(); }; diff --git a/packages/common/components/src/lib/auth-header.ts b/packages/common/components/src/lib/auth-header.ts new file mode 100644 index 000000000..962688504 --- /dev/null +++ b/packages/common/components/src/lib/auth-header.ts @@ -0,0 +1,22 @@ +import Cookies from "js-cookie"; +import { getConfig } from "@common/config"; + +export function getAuthHeaders(): HeadersInit { + const { CLAIM_NAME, AUTH_USER_ID } = getConfig(); + + if (!CLAIM_NAME || !AUTH_USER_ID) { + throw new Error("Required environment variables are not set"); + } + + const headers: Record = { + "Content-Type": "application/json", + }; + + const token = Cookies.get(CLAIM_NAME); + const userId = Cookies.get(AUTH_USER_ID); + + if (token) headers[CLAIM_NAME] = token; + if (userId) headers[AUTH_USER_ID] = userId; + + return headers; +} From 45f72f7333d3961ab124b8dfeb541fc5ebf338b3 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 20 Jul 2026 18:42:15 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[common/components]=20chore:=20auth-heade?= =?UTF-8?q?r=20=EC=B0=B8=EC=A1=B0=20=EA=B2=BD=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/components/src/api/banner.ts | 2 +- packages/common/components/src/api/menu.ts | 2 +- packages/common/components/src/api/site.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/common/components/src/api/banner.ts b/packages/common/components/src/api/banner.ts index 90cc6e0f5..330431c39 100644 --- a/packages/common/components/src/api/banner.ts +++ b/packages/common/components/src/api/banner.ts @@ -1,6 +1,6 @@ import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; -import { getAuthHeaders } from "@/lib/auth-header"; +import { getAuthHeaders } from "../lib/auth-header"; export interface Banner { bnrSn: number; diff --git a/packages/common/components/src/api/menu.ts b/packages/common/components/src/api/menu.ts index 788118b98..ee9e74357 100644 --- a/packages/common/components/src/api/menu.ts +++ b/packages/common/components/src/api/menu.ts @@ -1,4 +1,4 @@ -import { getAuthHeaders } from "@/lib/auth-header"; +import { getAuthHeaders } from "../lib/auth-header"; import { ENDPOINT } from "../config"; import { getConfig } from "@common/config"; diff --git a/packages/common/components/src/api/site.ts b/packages/common/components/src/api/site.ts index 86038ee8a..56f8a7c30 100644 --- a/packages/common/components/src/api/site.ts +++ b/packages/common/components/src/api/site.ts @@ -1,6 +1,6 @@ import { getConfig } from "@common/config"; import { ENDPOINT } from "../config"; -import { getAuthHeaders } from "@/lib/auth-header"; +import { getAuthHeaders } from "../lib/auth-header"; export interface SiteInfo { siteId: string; From d26cd90b02ad8653f0bfdfbe758d8bee82b1ee3c Mon Sep 17 00:00:00 2001 From: bicochan Date: Tue, 21 Jul 2026 09:20:37 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[common/components]=20feat:=20nofooter?= =?UTF-8?q?=EC=97=90=20authService=20props=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/src/ui/layout/nofooter.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/common/components/src/ui/layout/nofooter.tsx b/packages/common/components/src/ui/layout/nofooter.tsx index 12f14ceea..29b5cddf6 100644 --- a/packages/common/components/src/ui/layout/nofooter.tsx +++ b/packages/common/components/src/ui/layout/nofooter.tsx @@ -8,15 +8,18 @@ import { SidebarProvider } from "../sidebar"; import { LNB } from "../lnb"; import { Header } from "../header"; import "./common.css"; +import type { AuthService } from "@common/auth"; export function NoFooterLayout({ children, queryClient, + authService, currentPath, handleMenuClick, }: { children: React.ReactNode; queryClient?: QueryClient; + authService?: AuthService; currentPath?: string; handleMenuClick?: (item: MenuItem) => void; }) { @@ -26,19 +29,19 @@ export function NoFooterLayout({ -
-
-
- -
-
{children}
+
+
+
+ +
+
{children}
+
-
- + From a1d43dc65c9f0daab6faa1faef7c256b98542800 Mon Sep 17 00:00:00 2001 From: jcchoi Date: Tue, 21 Jul 2026 11:11:55 +0900 Subject: [PATCH 10/11] =?UTF-8?q?=EC=B0=A8=EC=88=98=20=EB=8B=A8=EC=96=B4?= =?UTF-8?q?=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../st/src/pages/statistics/ui/panels/schedule-info-panel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/st/src/pages/statistics/ui/panels/schedule-info-panel.tsx b/apps/st/src/pages/statistics/ui/panels/schedule-info-panel.tsx index 6a5e3602d..b678099d3 100644 --- a/apps/st/src/pages/statistics/ui/panels/schedule-info-panel.tsx +++ b/apps/st/src/pages/statistics/ui/panels/schedule-info-panel.tsx @@ -84,7 +84,7 @@ export function ScheduleInfoPanel({ params }: ScheduleInfoPanelProps) {
- {data.inptSeCd}차 입력기간 + 입력기간

{dayjs(data.inptBgngYmd).format( @@ -102,7 +102,7 @@ export function ScheduleInfoPanel({ params }: ScheduleInfoPanelProps) { color="gray" className="font-semibold" > - {data.vrfcSeCd}차 검증기간 + 검증기간

{dayjs(data.vrfcBgngYmd).format( From b41a317788f8b4d4b827f771d060c8619d0438d8 Mon Sep 17 00:00:00 2001 From: ljpark Date: Tue, 21 Jul 2026 17:59:15 +0900 Subject: [PATCH 11/11] =?UTF-8?q?wr:=20fo:=20sn:=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20session=20confirm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/(map-layout)/layout.tsx | 13 +++++++++++-- apps/sn/app/(map-layout)/layout.tsx | 2 ++ apps/wr/app/(map-layout)/layout.tsx | 10 +++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/fo/app/pages/(map-layout)/layout.tsx b/apps/fo/app/pages/(map-layout)/layout.tsx index 9c45eabc8..11ca87e00 100644 --- a/apps/fo/app/pages/(map-layout)/layout.tsx +++ b/apps/fo/app/pages/(map-layout)/layout.tsx @@ -1,9 +1,10 @@ 'use client' import { NoFooterLayout } from "@common/components"; +import { useQueryClient } from "@tanstack/react-query"; import type { MenuItem } from "../../store/common"; import { useFoStore } from "../../store"; import { usePathname, useRouter } from "next/navigation"; -// import { authService } from "@/src/entities/auth"; +import { authService } from "@/src/entities/auth"; export default function RootLayout({ children, @@ -14,12 +15,20 @@ export default function RootLayout({ const { getMenuAuth } = useFoStore((state) => state); const pathname = usePathname(); const router = useRouter(); + const queryClient = useQueryClient(); const handleClick = (id: MenuItem) => { getMenuAuth(id.menuCd); router.push(id.urlPath); }; return ( - {children} + + {children} + ); } diff --git a/apps/sn/app/(map-layout)/layout.tsx b/apps/sn/app/(map-layout)/layout.tsx index f840fa131..40565fb97 100644 --- a/apps/sn/app/(map-layout)/layout.tsx +++ b/apps/sn/app/(map-layout)/layout.tsx @@ -20,6 +20,7 @@ import { NoFooterLayout } from "@common/components"; import type { MenuItem } from "@/entities/menu"; import { useMenuStore } from "@/shared/lib"; import useStore from '../store/useStore'; +import { authService } from "@/entities/auth"; export default function MapLayout({ children, @@ -57,6 +58,7 @@ export default function MapLayout({ return ( diff --git a/apps/wr/app/(map-layout)/layout.tsx b/apps/wr/app/(map-layout)/layout.tsx index b6f52c19c..ee7321d7b 100644 --- a/apps/wr/app/(map-layout)/layout.tsx +++ b/apps/wr/app/(map-layout)/layout.tsx @@ -1,9 +1,11 @@ "use client"; import type { MenuItem } from "@common/components/api"; import { NoFooterLayout } from "@common/components/ui"; +import { useQueryClient } from "@tanstack/react-query"; import { usePathname,useRouter } from "next/navigation"; import { useMenuStore } from "@/src/shared/lib"; import { useWrStore } from "../store"; +import { authService } from "@/src/entities/auth"; export default function MapLayout({ children, @@ -14,6 +16,7 @@ export default function MapLayout({ const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo); const router = useRouter(); const pathname = usePathname(); + const queryClient = useQueryClient(); const changeMenu = (path: MenuItem) => { setCurrentMenuInfo(path); @@ -21,7 +24,12 @@ export default function MapLayout({ router.push(path.urlPath); }; return ( - + {children} );