feat(infisical-pg): fixed service token return body

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent bf059e0fe5
commit 6b7b888fb4
@@ -19,7 +19,7 @@ export const registerServiceTokenRouter = async (server: FastifyZodProvider) =>
onRequest: verifyAuth([AuthMode.JWT, AuthMode.SERVICE_TOKEN]), onRequest: verifyAuth([AuthMode.JWT, AuthMode.SERVICE_TOKEN]),
schema: { schema: {
response: { response: {
200: sanitizedServiceTokenSchema 200: sanitizedServiceTokenSchema.merge(z.object({ workspace: z.string() }))
} }
}, },
handler: async (req) => { handler: async (req) => {
@@ -27,7 +27,7 @@ export const registerServiceTokenRouter = async (server: FastifyZodProvider) =>
actorId: req.permission.id, actorId: req.permission.id,
actor: req.permission.type actor: req.permission.type
}); });
return serviceTokenData; return { ...serviceTokenData, workspace: serviceTokenData.projectId };
} }
}); });