From 9e54fd1bfbe9b41162df31692e6ac45f074ee79b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 17 Oct 2024 18:14:15 -0400 Subject: [PATCH] fix: User exists should account for deleted workspaces, closes #7793 --- plugins/google/server/auth/google.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/google/server/auth/google.ts b/plugins/google/server/auth/google.ts index c11b901f0a..4b8bbb319b 100644 --- a/plugins/google/server/auth/google.ts +++ b/plugins/google/server/auth/google.ts @@ -74,6 +74,12 @@ if (env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET) { if (!domain && !team) { const userExists = await User.count({ where: { email: profile.email.toLowerCase() }, + include: [ + { + association: "team", + required: true, + }, + ], }); // Users cannot create a team with personal gmail accounts