Skip to content

Commit

Permalink
revoke priv share link on deny
Browse files Browse the repository at this point in the history
  • Loading branch information
kadamidev committed Jan 8, 2025
1 parent 412db85 commit 7606301
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions desci-server/src/services/Contributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,17 @@ class ContributorService {
const contributorEmailMatchesUser = user.email === contribution.email;
const contributionUserIdMatchesUser = user.id === contribution.userId;
const verified = contributorEmailMatchesUser || contributionOrcidMatchesUser || contributionUserIdMatchesUser;
if (verified) {
const updated = await prisma.nodeContribution.update({
where: { id: contribution.id },
data: { denied: true, verified: false },
});
if (!verified) return false;

// TBC: Consider revoking the share code as well.
if (updated) return true;
}
const updated = await prisma.nodeContribution.update({
where: { id: contribution.id },
data: { denied: true, verified: false },
});

const node = await prisma.node.findUnique({ where: { id: contribution.nodeId } });
this.removePrivShareCodeForContribution(updated, node);

if (updated) return true;

return false;
}
Expand Down

0 comments on commit 7606301

Please sign in to comment.