Fix subdomain check in domain verification

This commit is contained in:
Dries Augustyns
2025-10-02 10:52:23 +02:00
parent a1ff2114d5
commit ca5935924f
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "plunk", "name": "plunk",
"version": "1.3.5", "version": "1.3.6",
"private": true, "private": true,
"license": "agpl-3.0", "license": "agpl-3.0",
"workspaces": { "workspaces": {
+2 -3
View File
@@ -53,9 +53,8 @@ export class Identities {
throw new NotFound("project"); throw new NotFound("project");
} }
const existingProject = await prisma.project.findFirst({ const domain = email.split('@')[1];
where: { email: { endsWith: email.split("@")[1] } }, const existingProject = await prisma.project.findFirst({where: {email: {endsWith: `@${domain}`}}});
});
if (existingProject) { if (existingProject) {
throw new Error("Domain already attached to another project"); throw new Error("Domain already attached to another project");