MM-58245 Don't allow patching real email or username for remote users (#27613)

* don't allow patching real email or username for remote users

* add comment
Этот коммит содержится в:
Doug Lauder
2024-07-11 04:17:09 -04:00
коммит произвёл GitHub
родитель 177389d224
Коммит 19d59d1126

Просмотреть файл

@@ -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,