refactor: session handler

This commit is contained in:
Huskydog9988
2025-04-03 19:15:33 -04:00
parent 97043d6366
commit a9d1a442f6
13 changed files with 189 additions and 168 deletions
@@ -2,8 +2,8 @@ import clientHandler from "~/server/internal/clients/handler";
import sessionHandler from "~/server/internal/session";
export default defineEventHandler(async (h3) => {
const userId = await sessionHandler.getUserId(h3);
if (!userId) throw createError({ statusCode: 403 });
const user = await sessionHandler.getSession(h3);
if (!user) throw createError({ statusCode: 403 });
const body = await readBody(h3);
const clientId = await body.id;