client initiate

This commit is contained in:
DecDuck
2024-10-08 13:17:30 +11:00
parent ceacd8469d
commit 909432a6ce
8 changed files with 66 additions and 9 deletions

View File

@ -0,0 +1,3 @@
export default defineEventHandler((h3) => {
});

View File

@ -0,0 +1,3 @@
export default defineEventHandler((h3) => {
});

View File

@ -1,3 +1,18 @@
export default defineEventHandler(async (h3) => {
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`;
});