Feat: Return client id of newly created client (#2190)

return client id of newly created client
This commit is contained in:
Bernd Storath
2025-09-29 08:20:00 +02:00
committed by GitHub
parent 7b2d234ea5
commit cbbf5d3d25
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -9,8 +9,10 @@ export default definePermissionEventHandler(
validateZod(ClientCreateSchema, event)
);
await Database.clients.create({ name, expiresAt });
const result = await Database.clients.create({ name, expiresAt });
await WireGuard.saveConfig();
return { success: true };
const clientId = result[0]!.clientId;
return { success: true, clientId };
}
);