From 63ab79b910387178847d7813c1edb128a9f3562a Mon Sep 17 00:00:00 2001 From: hskwon Date: Fri, 14 Nov 2025 14:51:10 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ApiKeyMiddleware=20null=20route=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - request->route()가 null일 때 발생하는 오류 수정 - null-safe 연산자(?->) 및 null coalescing 연산자(??) 사용 - Line 122: route()->uri() → route()?->uri() ?? path() --- app/Http/Middleware/ApiKeyMiddleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/ApiKeyMiddleware.php b/app/Http/Middleware/ApiKeyMiddleware.php index be2a0cd..d2c0eb3 100644 --- a/app/Http/Middleware/ApiKeyMiddleware.php +++ b/app/Http/Middleware/ApiKeyMiddleware.php @@ -119,7 +119,7 @@ public function handle(Request $request, Closure $next) ]; // 현재 라우트 확인 (경로 또는 이름) - $currentRoute = $request->route()->uri(); // 또는 $request->path() + $currentRoute = $request->route()?->uri() ?? $request->path(); if (! in_array($currentRoute, $allowWithoutAuth)) { // 인증정보(api_user, tenant_id) 없으면 튕김