fix: [sync] config:cache 환경에서 동기화 API 401 오류 수정

menu_sync_api_key를 config/app.php에 등록하여 config:cache 후에도
env() 값이 정상 반환되도록 수정. 컨트롤러에서 env() 직접 호출 제거.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 16:39:36 +09:00
parent 5e1a093476
commit 31246e3317
4 changed files with 18 additions and 6 deletions

View File

@@ -98,7 +98,7 @@ public function export(Request $request): JsonResponse
{
// API Key 검증
$apiKey = $request->header('X-Menu-Sync-Key');
$validKey = config('app.menu_sync_api_key', env('MENU_SYNC_API_KEY'));
$validKey = config('app.menu_sync_api_key');
if (empty($validKey) || $apiKey !== $validKey) {
return response()->json(['error' => 'Unauthorized'], 401);
@@ -125,7 +125,7 @@ public function import(Request $request): JsonResponse
{
// API Key 검증
$apiKey = $request->header('X-Menu-Sync-Key');
$validKey = config('app.menu_sync_api_key', env('MENU_SYNC_API_KEY'));
$validKey = config('app.menu_sync_api_key');
if (empty($validKey) || $apiKey !== $validKey) {
return response()->json(['error' => 'Unauthorized'], 401);