게시물 상세 사이드바 목차·광고 재배치와 세션 확인 개선

게시물 상세에서는 오른쪽 사이드에 목차와 광고를 배치하고, 비로그인 세션 확인 시 콘솔 401 로그가 나지 않도록 정리했다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 15:40:35 +09:00
parent eba7704ab8
commit 06271b3674
15 changed files with 214 additions and 61 deletions

View File

@@ -1,13 +1,19 @@
import { requireAdminSession } from '../../../../utils/admin-auth'
import { getAdminSession, requireAdminSession } from '../../../../utils/admin-auth'
import { getMemberForAdmin } from '../../../../repositories/member-repository'
/**
* 관리자 세션 조회 API
* @param {import('h3').H3Event} event - 요청 이벤트
* @returns {Promise<{ userId: string, email: string, role: 'admin', roleCode: string, roleLabel: string }>} 관리자 세션 정보
* @returns {Promise<{ userId: string, email: string, role: 'admin', roleCode: string, roleLabel: string } | null>} 관리자 세션 정보
*/
export default defineEventHandler(async (event) => {
const session = requireAdminSession(event)
const isOptional = getQuery(event).optional === '1'
const session = isOptional ? getAdminSession(event) : requireAdminSession(event)
if (!session) {
return null
}
const member = await getMemberForAdmin(session.userId)
return {