mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 19:26:19 +00:00
Added formatting
This commit is contained in:
@@ -36,8 +36,19 @@ export const registerServiceTokenRouter = async (server: FastifyZodProvider) =>
|
|||||||
actor: req.permission.type
|
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.
|
// 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 };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user