관리자와 회원 설정 계정 작업 정리

This commit is contained in:
2026-05-13 15:26:26 +09:00
parent 6481f958f5
commit bebf7ee1c9
18 changed files with 811 additions and 175 deletions

View File

@@ -1,8 +1,8 @@
import { z } from 'zod'
import { createError, readBody } from 'h3'
import { createError, getRequestIP, readBody } from 'h3'
import bcrypt from 'bcrypt'
import { setAdminSession } from '../../../../utils/admin-auth'
import { getAdminUserByEmail } from '../../../../repositories/member-repository'
import { getAdminUserByEmail, touchUserActivity } from '../../../../repositories/member-repository'
import { setMemberSession } from '../../../../utils/member-auth'
const loginSchema = z.object({
@@ -47,6 +47,10 @@ export default defineEventHandler(async (event) => {
userId: adminUser.id,
email: adminUser.email
})
await touchUserActivity({
userId: adminUser.id,
ip: String(getRequestIP(event) || '')
})
return {
userId: adminUser.id,