fix(auth): pagePermission 미들웨어 getPool await 누락 수정

getDb()가 async(Promise 반환)인데 await 없이 호출하여
non-admin 사용자 API 호출 시 db.query is not a function 에러 발생.
admin은 L18에서 조기 리턴하여 영향 없었음.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-01 15:09:47 +09:00
parent cc69b452ab
commit b70904a4de

View File

@@ -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(