관리자와 회원 설정 계정 작업 정리
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user