fix: getSession to getDbSession to avoid h3 conflict
This commit is contained in:
@@ -12,7 +12,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
// DB에서 세션 조회
|
||||
const session = await getSession(sessionId)
|
||||
const session = await getDbSession(sessionId)
|
||||
|
||||
if (!session) {
|
||||
// 세션이 만료되었거나 없음 → 쿠키 삭제
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getSession, getSessionIdFromCookie, deleteSessionCookie, SESSION_TIMEOUT_MINUTES } from '../../utils/session'
|
||||
import { getDbSession, getSessionIdFromCookie, deleteSessionCookie, SESSION_TIMEOUT_MINUTES } from '../../utils/session'
|
||||
|
||||
/**
|
||||
* 본인 로그인 이력 조회
|
||||
@@ -11,7 +11,7 @@ export default defineEventHandler(async (event) => {
|
||||
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
|
||||
}
|
||||
|
||||
const session = await getSession(sessionId)
|
||||
const session = await getDbSession(sessionId)
|
||||
|
||||
if (!session) {
|
||||
deleteSessionCookie(event)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getClientIp } from '../../utils/ip'
|
||||
import { getSession, deleteSession, getSessionIdFromCookie, deleteSessionCookie } from '../../utils/session'
|
||||
import { getDbSession, deleteSession, getSessionIdFromCookie, deleteSessionCookie } from '../../utils/session'
|
||||
|
||||
/**
|
||||
* 로그아웃
|
||||
@@ -11,7 +11,7 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
if (sessionId) {
|
||||
// 세션 정보 조회
|
||||
const session = await getSession(sessionId)
|
||||
const session = await getDbSession(sessionId)
|
||||
|
||||
// 로그아웃 이력 기록
|
||||
if (session?.loginHistoryId) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getSession, getSessionIdFromCookie, deleteSessionCookie } from '../../utils/session'
|
||||
import { getDbSession, getSessionIdFromCookie, deleteSessionCookie } from '../../utils/session'
|
||||
|
||||
/**
|
||||
* 로그인된 사용자 상세 정보 조회
|
||||
@@ -12,7 +12,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
// DB에서 세션 조회
|
||||
const session = await getSession(sessionId)
|
||||
const session = await getDbSession(sessionId)
|
||||
|
||||
if (!session) {
|
||||
deleteSessionCookie(event)
|
||||
|
||||
Reference in New Issue
Block a user