Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Added formatting

Daniel Hougaard3702d411ca3d
diff --git a/backend/src/server/routes/v2/service-token-router.ts b/backend/src/server/routes/v2/service-token-router.ts
index 52e4d7334b..cb285a8cc1 100644
--- a/backend/src/server/routes/v2/service-token-router.ts
+++ b/backend/src/server/routes/v2/service-token-router.ts
@@ -36,8 +36,19 @@ export const registerServiceTokenRouter = async (server: FastifyZodProvider) =>
actor: req.permission.type
});
+ const formattedUser = {
+ ...user,
+ _id: user.id,
+ __v: 0
+ } as const;
+
+ const formattedServiceToken = {
+ ...serviceToken,
+ _id: serviceToken.id
+ } as const;
+
// We return the user here because older versions of the deprecated Python SDK depend on it to properly parse the API response.
- return { ...serviceToken, workspace: serviceToken.projectId, user };
+ return { ...formattedServiceToken, workspace: serviceToken.projectId, user: formattedUser };
}
});