getCookie 제거

This commit is contained in:
2026-01-10 21:59:11 +09:00
parent ef7914d5c6
commit 1b8cd8577e
30 changed files with 195 additions and 145 deletions

View File

@@ -1,4 +1,5 @@
import { query } from '../../../utils/db'
import { requireAuth } from '../../../utils/session'
const ADMIN_EMAIL = 'coziny@gmail.com'
@@ -19,10 +20,8 @@ const ADMIN_EMAIL = 'coziny@gmail.com'
* - limit: 조회 개수 (기본 100)
*/
export default defineEventHandler(async (event) => {
const userId = getCookie(event, 'user_id')
if (!userId) {
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
}
// 세션 기반 인증 사용
const userId = await requireAuth(event)
// 현재 사용자 정보 조회 (관리자 여부 확인)
const currentUser = await query<any>(`