From b70904a4deb02f0b595b1ee057c439fbdedf4415 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Wed, 1 Apr 2026 15:09:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(auth):=20pagePermission=20=EB=AF=B8?= =?UTF-8?q?=EB=93=A4=EC=9B=A8=EC=96=B4=20getPool=20await=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getDb()가 async(Promise 반환)인데 await 없이 호출하여 non-admin 사용자 API 호출 시 db.query is not a function 에러 발생. admin은 L18에서 조기 리턴하여 영향 없었음. Co-Authored-By: Claude Opus 4.6 (1M context) --- shared/middleware/pagePermission.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/middleware/pagePermission.js b/shared/middleware/pagePermission.js index 03a9232..73ca3c2 100644 --- a/shared/middleware/pagePermission.js +++ b/shared/middleware/pagePermission.js @@ -18,7 +18,7 @@ function createRequirePage(getPool) { if (role === 'admin' || role === 'system') return next(); try { - const db = typeof getPool === 'function' ? getPool() : getPool; + const db = typeof getPool === 'function' ? await getPool() : getPool; // 1. 개인 권한 체크 const [rows] = await db.query(