summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-12-09 10:59:54 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-12-09 10:59:54 +0000
commit6c3edc483de65e2666e2ede764daa900a7cc2b4b (patch)
treeea92913e15bda9519fd9fdbeaa99ab1377102845
parent09858255bcea648c01939447233fea9e955a36ee (diff)
(임수민) 공동인증 middleware 수정HEADdujinkim
-rw-r--r--middleware.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/middleware.ts b/middleware.ts
index 4e222e6c..493c9adc 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -213,6 +213,15 @@ export async function middleware(request: NextRequest) {
}
const { pathname, searchParams, origin } = request.nextUrl;
+
+ /**
+ * 2-1. TrustNet 등 정적 경로는 언어 경로 추가하지 않고 그대로 통과 (최우선 처리)
+ * TrustNet은 Tomcat 서버에서 처리되므로 Next.js middleware가 개입하지 않음
+ */
+ if (pathname.startsWith('/trustnet')) {
+ console.log('[Middleware] TrustNet 경로 감지, 통과:', pathname, 'query:', searchParams.toString());
+ return NextResponse.next();
+ }
/**
* 3. "/" 경로로 들어온 경우 -> "/{lng}"로 리다이렉트
@@ -224,14 +233,6 @@ export async function middleware(request: NextRequest) {
}
/**
- * 3-1. TrustNet 등 정적 경로는 언어 경로 추가하지 않고 그대로 통과
- * TrustNet은 Tomcat 서버에서 처리되므로 Next.js middleware가 개입하지 않음
- */
- if (pathname.startsWith('/trustnet')) {
- return NextResponse.next();
- }
-
- /**
* 4. 현재 pathname이 언어 경로를 포함하고 있는지 확인
*/
const hasValidLngInPath = languages.some(