finalised client APIs and authentication method

This commit is contained in:
DecDuck
2024-10-09 00:37:11 +11:00
parent 425934d3ef
commit d4e2dc8cb6
10 changed files with 112 additions and 5 deletions

View File

@ -0,0 +1,18 @@
import clientHandler from "~/server/internal/clients/handler";
export default defineEventHandler(async (h3) => {
const body = await readBody(h3);
const name = body.name;
const platform = body.platform;
if (!name || !platform)
throw createError({
statusCode: 400,
statusMessage: "Missing name or platform in body",
});
const clientId = await clientHandler.initiate({ name, platform });
return `/client/${clientId}/callback`;
});