getCookie 제거
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import type { H3Event } from 'h3'
|
||||
import { queryOne } from './db'
|
||||
import { getAuthenticatedUserId } from './session'
|
||||
|
||||
/**
|
||||
* 현재 로그인한 사용자의 이메일 조회
|
||||
*/
|
||||
export async function getCurrentUserEmail(event: H3Event): Promise<string | null> {
|
||||
const userId = getCookie(event, 'user_id')
|
||||
const userId = await getAuthenticatedUserId(event)
|
||||
if (!userId) return null
|
||||
|
||||
const user = await queryOne<{ employee_email: string }>(`
|
||||
SELECT employee_email FROM wr_employee_info WHERE employee_id = $1
|
||||
`, [parseInt(userId)])
|
||||
`, [userId])
|
||||
|
||||
return user?.employee_email || null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user