From 1488341f66e28bc7a7ee15889df2eac797e6060e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 11 Feb 2026 18:45:47 -0500 Subject: [PATCH] fix: Remove unnecessary loading of authentication rows in `userProvisioner` (#11413) * fix: Remove unneccessary loading of authentication rows in userProvisioner * test --- server/commands/accountProvisioner.test.ts | 1 - server/commands/userProvisioner.ts | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/server/commands/accountProvisioner.test.ts b/server/commands/accountProvisioner.test.ts index a3f637da69..0d24074609 100644 --- a/server/commands/accountProvisioner.test.ts +++ b/server/commands/accountProvisioner.test.ts @@ -145,7 +145,6 @@ describe("accountProvisioner", () => { expect(user.id).toEqual(userWithoutAuth.id); expect(isNewTeam).toEqual(false); expect(isNewUser).toEqual(false); - expect(user.authentications.length).toEqual(0); }); it("should throw an error when authentication provider is disabled", async () => { diff --git a/server/commands/userProvisioner.ts b/server/commands/userProvisioner.ts index ef16c97e1f..0a280a2eec 100644 --- a/server/commands/userProvisioner.ts +++ b/server/commands/userProvisioner.ts @@ -121,10 +121,7 @@ export default async function userProvisioner( // A `user` record may exist even if there is no existing authentication record. // This is either an invite or a user that's external to the team - const existingUser = await User.scope([ - "withAuthentications", - "withTeam", - ]).findOne({ + const existingUser = await User.scope(["withTeam"]).findOne({ where: { // Email from auth providers may be capitalized email: {