Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,16 @@ private User checkAndCreateUser(String userDn, String email, String userName) th

// Check if the user exists in OM Database
try {
User omUser =
userRepository.getByEmail(null, email, userRepository.getFields("id,name,email,roles"));
// Load the same field set the PUT path uses (USER_UPDATE_FIELDS): roles, teams,
// profile, authenticationMechanism, isEmailVerified, personas, defaultPersona,
// domains, personaPreferences. UserUpdater.entitySpecificUpdate runs updateTeams /
// updatePersonas / etc. unconditionally; with a sparse fetch those fields arrive
// null and the updater wipes the corresponding relationships, which destroys the
// user's manually-assigned teams on every LDAP login and makes login slow (deleteTo
// does work proportional to the user's existing team count). Use getPutFields()
// (narrow) rather than getFieldsWithUserAuth("*") (wide) so we don't eagerly load
// the heavy owns/follows relationship sets on every login.
User omUser = userRepository.getByEmail(null, email, userRepository.getPutFields());
getRoleForLdap(userDn, omUser, Boolean.TRUE);
finalUser = omUser;
} catch (EntityNotFoundException ex) {
Expand Down
Loading