Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ldap-merge-email-lookup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/models': patch
'@rocket.chat/meteor': patch
---

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.
2 changes: 1 addition & 1 deletion packages/models/src/models/Users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ export class UsersRaw extends BaseRaw<IUser, DefaultFields<IUser>> implements IU

findOneWithoutLDAPByEmailAddress(emailAddress: string, options?: FindOptions<IUser>) {
const query = {
'email.address': emailAddress.trim().toLowerCase(),
'emails.address': emailAddress.trim().toLowerCase(),
'services.ldap': {
$exists: false,
},
Expand Down
Loading