Skip to content

Commit 4655e86

Browse files
authored
fix: LDAP users not merging by email during sync (#41279)
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
1 parent b3699f2 commit 4655e86

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/models': patch
3+
'@rocket.chat/meteor': patch
4+
---
5+
6+
Fixes LDAP sync failing to merge an existing user matched by email, which caused a `Username already exists` error when the user's username differed from the directory.

packages/models/src/models/Users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ export class UsersRaw extends BaseRaw<IUser, DefaultFields<IUser>> implements IU
22642264

22652265
findOneWithoutLDAPByEmailAddress(emailAddress: string, options?: FindOptions<IUser>) {
22662266
const query = {
2267-
'email.address': emailAddress.trim().toLowerCase(),
2267+
'emails.address': emailAddress.trim().toLowerCase(),
22682268
'services.ldap': {
22692269
$exists: false,
22702270
},

0 commit comments

Comments
 (0)