ㅋㅓ밋

This commit is contained in:
2026-01-04 21:31:45 +09:00
parent 0660ed3973
commit 93187f3809
13 changed files with 903 additions and 59 deletions

View File

@@ -6,6 +6,8 @@ import { query } from '../../utils/db'
*/
export default defineEventHandler(async (event) => {
const userId = getCookie(event, 'user_id')
const currentHistoryId = getCookie(event, 'login_history_id')
if (!userId) {
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
}
@@ -31,7 +33,8 @@ export default defineEventHandler(async (event) => {
loginIp: h.login_ip,
logoutAt: h.logout_at,
logoutIp: h.logout_ip,
lastActiveAt: h.last_active_at
lastActiveAt: h.last_active_at,
isCurrentSession: currentHistoryId && h.history_id === parseInt(currentHistoryId)
}))
}
})