From ca5935924f5789870d4d4c9beda8de72422b2fbc Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Thu, 2 Oct 2025 10:52:23 +0200 Subject: [PATCH] Fix subdomain check in domain verification --- package.json | 2 +- packages/api/src/controllers/Identities.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 97cc53a..21e774a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plunk", - "version": "1.3.5", + "version": "1.3.6", "private": true, "license": "agpl-3.0", "workspaces": { diff --git a/packages/api/src/controllers/Identities.ts b/packages/api/src/controllers/Identities.ts index 730918a..bd353ee 100644 --- a/packages/api/src/controllers/Identities.ts +++ b/packages/api/src/controllers/Identities.ts @@ -53,9 +53,8 @@ export class Identities { throw new NotFound("project"); } - const existingProject = await prisma.project.findFirst({ - where: { email: { endsWith: email.split("@")[1] } }, - }); + const domain = email.split('@')[1]; + const existingProject = await prisma.project.findFirst({where: {email: {endsWith: `@${domain}`}}}); if (existingProject) { throw new Error("Domain already attached to another project");