fix(telemetry): added back email for telemetry when using service token

This commit is contained in:
Akhil Mohan
2024-02-22 17:09:33 +05:30
parent acfa89ba8b
commit be49de5f34
6 changed files with 31 additions and 7 deletions
@@ -177,6 +177,8 @@ export const permissionServiceFactory = ({
const getServiceTokenProjectPermission = async (serviceTokenId: string, projectId: string) => {
const serviceToken = await serviceTokenDAL.findById(serviceTokenId);
if (!serviceToken) throw new BadRequestError({ message: "Service token not found" });
if (serviceToken.projectId !== projectId)
throw new UnauthorizedError({
message: "Failed to find service authorization for given project"