// /api/middleware/auth.js
import { getHeaders } from 'h3'

export default defineEventHandler(async (event) => {
  const reqHeaders = getHeaders(event)
  const ssrHeader = new Headers()
  const { app } = useRuntimeConfig()
  ssrHeader.set('cookie', reqHeaders.cookie)
  ssrHeader.set('x-xsrf-token', app['XSRF_HEADER'])
  ssrHeader.set('app-id', app['APP_ID'])
//   ssrHeader.set('client-id', await getFingerPrint())
  event.context.headers = ssrHeader
  event.context.baseUrl = app['BASE_URL']
})