Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update name

Kiran K34950bc418d1
diff --git a/apps/web/app/api/tokens/route.ts b/apps/web/app/api/tokens/route.ts
index 41d64f05cc..f8d8088888 100644
--- a/apps/web/app/api/tokens/route.ts
+++ b/apps/web/app/api/tokens/route.ts
@@ -21,7 +21,7 @@ export const POST = withWorkspace(async ({ req, session, workspace }) => {
if (isMachine) {
machineUser = await prisma.user.create({
data: {
- name,
+ name: "Machine user",
isMachine: true,
},
});
@@ -37,9 +37,9 @@ export const POST = withWorkspace(async ({ req, session, workspace }) => {
name,
hashedKey,
partialKey,
- userId: machineUser ? machineUser.id : session.user.id,
+ userId: isMachine ? machineUser?.id! : session.user.id,
projectId: workspace.id,
- scopes: scopes ? scopes.join(" ") : null,
+ scopes: scopes && scopes.length > 0 ? scopes.join(" ") : null,
},
});