From 181f1b258f5c37b3de6312c0e220acf7c50a3f17 Mon Sep 17 00:00:00 2001 From: hskwon Date: Fri, 25 Jul 2025 09:12:53 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EB=A1=9C=EA=B7=B8,=20=EC=95=8C?= =?UTF-8?q?=EB=9E=8C=20=EC=84=A4=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Exceptions/Handler.php | 7 +++++-- app/Http/Middleware/ApiKeyMiddleware.php | 20 +------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3bffe95..8dbd057 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -10,7 +10,10 @@ class Handler extends ExceptionHandler { public function report(Throwable $e): void { - if (app()->environment('local') || app()->environment('production')) { + if ( + app()->environment('local') || app()->environment('production') + || app()->environment('LOCAL') || app()->environment('DEV') + ) { $this->sendSlackException($e); } @@ -25,7 +28,7 @@ protected function sendSlackException(Throwable $e): void if (!$url) return; Http::post($url, [ - 'text' => "*๐Ÿšจ Laravel ์˜ˆ์™ธ ๋ฐœ์ƒ!*\n" . + 'text' => "*๐Ÿšจ[".env('APP_ENV')."] Laravel ์˜ˆ์™ธ ๋ฐœ์ƒ!*\n" . "โ€ข ๋ฉ”์‹œ์ง€: `{$e->getMessage()}`\n" . "โ€ข ์œ„์น˜: `{$e->getFile()}:{$e->getLine()}`\n" . "โ€ข ์‹œ๊ฐ„: " . now()->toDateTimeString() diff --git a/app/Http/Middleware/ApiKeyMiddleware.php b/app/Http/Middleware/ApiKeyMiddleware.php index 5b327bd..4005127 100644 --- a/app/Http/Middleware/ApiKeyMiddleware.php +++ b/app/Http/Middleware/ApiKeyMiddleware.php @@ -34,24 +34,6 @@ public function handle(Request $request, Closure $next) ->where('key', $apiKey) ->where('is_active', true) ->exists(); - - // 2. ํšŒ์› ์ธ์ฆ (remember_token์œผ๋กœ) - if (!$validApiKey) { - $user = Member::where('remember_token', $apiKey)->first(); - - if ($user) { - $validApiKey = true; - - // โœ… ์„ธ์…˜์— ์œ ์ € ์ •๋ณด ์ €์žฅ - session(['Adm' => [ - 'idx' => $user->mb_num, - 'id' => $user->mb_id, - 'name' => $user->mb_name, - 'level' => $user->mb_level, - 'token' => $user->remember_token, - ]]); - } - } } if (!$validApiKey) { @@ -76,7 +58,7 @@ public function handle(Request $request, Closure $next) Log::info('API Response', [ 'uri' => $request->getRequestUri(), 'status' => $response->getStatusCode(), - // 'content' => $response->getContent(), // ์‘๋‹ต body๋„ ์›ํ•˜๋ฉด! + 'content' => $response->getContent(), // ์‘๋‹ต body๋„ ์›ํ•˜๋ฉด! ]); return $response;