fix: audience and empty app name (#2775)

This commit is contained in:
Livio Amstutz
2021-12-03 14:24:29 +01:00
committed by GitHub
parent 45695d3198
commit a8eed4a215
4 changed files with 46 additions and 25 deletions

View File

@@ -4,13 +4,14 @@ import (
"context"
"github.com/caos/logging"
"github.com/lib/pq"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/eventstore/handler"
"github.com/caos/zitadel/internal/eventstore/handler/crdb"
"github.com/caos/zitadel/internal/repository/project"
"github.com/lib/pq"
)
type AppProjection struct {
@@ -152,6 +153,9 @@ func (p *AppProjection) reduceAppChanged(event eventstore.EventReader) (*handler
logging.LogWithFields("HANDL-4Fjh2", "seq", event.Sequence(), "expectedType", project.ApplicationChangedType).Error("wrong event type")
return nil, errors.ThrowInvalidArgument(nil, "HANDL-ZJ8JA", "reduce.wrong.event.type")
}
if e.Name == "" {
return crdb.NewNoOpStatement(event), nil
}
return crdb.NewUpdateStatement(
e,
[]handler.Column{