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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user