Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added check for sharing project with yourself

Blue Mouse16b980134d82
diff --git a/src/project/project.controller.ts b/src/project/project.controller.ts
index 6d2b2ad7a..94f3e3ee4 100644
--- a/src/project/project.controller.ts
+++ b/src/project/project.controller.ts
@@ -530,6 +530,10 @@ export class ProjectController {
throw new NotFoundException(`User with email ${shareDTO.email} is not registered on Swetrix`)
}
+ if (invitee.id === user.id) {
+ throw new BadRequestException('You cannot share with yourself')
+ }
+
// TODO: Check if the invitee already has the project
// TODO: Send an email to the invitee with a link to confirm the share (the email is valid for 48 hours)