mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-12 15:52:39 +10:00
client initiate
This commit is contained in:
3
server/api/v1/client/callback/index.get.ts
Normal file
3
server/api/v1/client/callback/index.get.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default defineEventHandler((h3) => {
|
||||
|
||||
});
|
||||
3
server/api/v1/client/callback/index.post.ts
Normal file
3
server/api/v1/client/callback/index.post.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default defineEventHandler((h3) => {
|
||||
|
||||
});
|
||||
@ -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`;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user