We need to generate a niceId every time we make a client

This commit is contained in:
Owen
2025-12-07 11:07:08 -05:00
parent 110e950476
commit 5e9d660e26

View File

@@ -22,6 +22,7 @@ import { isIpInCidr } from "@server/lib/ip";
import { listExitNodes } from "#dynamic/lib/exitNodes";
import { OpenAPITags, registry } from "@server/openApi";
import { rebuildClientAssociationsFromClient } from "@server/lib/rebuildClientAssociations";
import { getUniqueClientName } from "@server/db/names";
const paramsSchema = z
.object({
@@ -211,11 +212,14 @@ export async function createUserClient(
);
}
const niceId = await getUniqueClientName(orgId);
[newClient] = await trx
.insert(clients)
.values({
exitNodeId: randomExitNode.exitNodeId,
orgId,
niceId,
name,
subnet: updatedSubnet,
type,