Skip to content

Commit

Permalink
MM-58245 Don't allow patching real email or username for remote users (
Browse files Browse the repository at this point in the history
…#27613) (#27622)

Automatic Merge
  • Loading branch information
mattermost-build authored Jul 11, 2024
1 parent e990b1c commit cf6d80f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/platform/services/sharedchannel/sync_recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,15 @@ func (scs *Service) upsertSyncUser(c request.CTX, user *model.User, channel *mod
)
return nil, fmt.Errorf("error updating user: %w", ErrRemoteIDMismatch)
}
// save the updated username and email in props
user.SetProp(model.UserPropsKeyRemoteUsername, user.Username)
user.SetProp(model.UserPropsKeyRemoteEmail, user.Email)
// TODO: MM-59398: allow patching username with munged, unique name

patch := &model.UserPatch{
Username: &user.Username,
Nickname: &user.Nickname,
FirstName: &user.FirstName,
LastName: &user.LastName,
Email: &user.Email,
Props: user.Props,
Position: &user.Position,
Locale: &user.Locale,
Expand Down

0 comments on commit cf6d80f

Please sign in to comment.