diff --git a/backend/src/services/secret-sharing/secret-sharing-service.ts b/backend/src/services/secret-sharing/secret-sharing-service.ts index 6e03bba22f..171ab54db5 100644 --- a/backend/src/services/secret-sharing/secret-sharing-service.ts +++ b/backend/src/services/secret-sharing/secret-sharing-service.ts @@ -272,11 +272,11 @@ export const secretSharingServiceFactory = ({ ? await secretSharingDAL.findById(sharedSecretId) : await secretSharingDAL.findOne({ identifier: sharedSecretId }); - const deletedSharedSecret = await secretSharingDAL.deleteById(sharedSecretId); - if (sharedSecret.orgId && sharedSecret.orgId !== orgId) throw new ForbiddenRequestError({ message: "User does not have permission to delete shared secret" }); + const deletedSharedSecret = await secretSharingDAL.deleteById(sharedSecretId); + return deletedSharedSecret; };