15 lines
380 B
TypeScript
15 lines
380 B
TypeScript
|
|
export default defineEventHandler(async (event) => {
|
|
// this one requires auth
|
|
//const login = fetch("http://127.0.0.1:81/login");
|
|
console.log(await readBody(event))
|
|
|
|
const session = await getUserSession(event)
|
|
console.log(session)
|
|
try {
|
|
const userId = session.secure!.user_id;
|
|
}
|
|
catch {
|
|
throw createError({ status: 401 })
|
|
}
|
|
}) |