From d981f0d34813144179cc8061661937c4a5478aa1 Mon Sep 17 00:00:00 2001 From: Silvan Date: Wed, 5 Apr 2023 13:42:00 +0200 Subject: [PATCH] fix(saml): correct handling of remove (#5606) --- internal/command/project_application_saml_model.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/command/project_application_saml_model.go b/internal/command/project_application_saml_model.go index ee697a029..2652acc61 100644 --- a/internal/command/project_application_saml_model.go +++ b/internal/command/project_application_saml_model.go @@ -241,12 +241,11 @@ func (wm *SAMLEntityIDsWriteModel) Reduce() error { for _, event := range wm.Events { switch e := event.(type) { case *project.ApplicationRemovedEvent: - removeAppIDFromEntityIDs(wm.EntityIDs, e.AppID) + wm.EntityIDs = removeAppIDFromEntityIDs(wm.EntityIDs, e.AppID) case *project.SAMLConfigAddedEvent: wm.EntityIDs = append(wm.EntityIDs, &AppIDToEntityID{AppID: e.AppID, EntityID: e.EntityID}) case *project.SAMLConfigChangedEvent: - for i := range wm.EntityIDs { - item := wm.EntityIDs[i] + for _, item := range wm.EntityIDs { if e.AppID == item.AppID && e.EntityID != "" { item.EntityID = e.EntityID }