getCookie 제거
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { defineEventHandler, readBody, createError, getCookie } from 'h3'
|
||||
import { defineEventHandler, readBody, createError } from 'h3'
|
||||
import { query, queryOne, execute, insertReturning } from '../../../utils/db'
|
||||
import { getClientIp } from '../../../utils/ip'
|
||||
import { getCurrentUserEmail } from '../../../utils/user'
|
||||
import { requireAuth } from '../../../utils/session'
|
||||
import OpenAI from 'openai'
|
||||
|
||||
interface AggregateBody {
|
||||
@@ -19,10 +20,7 @@ const openai = new OpenAI({
|
||||
* POST /api/report/summary/aggregate
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
const userId = getCookie(event, 'user_id')
|
||||
if (!userId) {
|
||||
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
|
||||
}
|
||||
const userId = await requireAuth(event)
|
||||
|
||||
const body = await readBody<AggregateBody>(event)
|
||||
const clientIp = getClientIp(event)
|
||||
|
||||
Reference in New Issue
Block a user