Skip to content

Commit

Permalink
fix: remove duplicate SessionIssued event (#3351)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Jul 4, 2023
1 parent 08fed36 commit b1e78ad
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions session/manager_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (
"net/url"
"time"

"go.opentelemetry.io/otel/trace"

"github.com/ory/kratos/x/events"

"github.com/ory/kratos/selfservice/flow"
"github.com/ory/kratos/selfservice/sessiontokenexchange"
"github.com/ory/kratos/ui/node"
Expand Down Expand Up @@ -82,7 +78,6 @@ func (s *ManagerHTTP) UpsertAndIssueCookie(ctx context.Context, w http.ResponseW
ctx, span := s.r.Tracer(ctx).Tracer().Start(ctx, "sessions.ManagerHTTP.UpsertAndIssueCookie")
defer otelx.End(span, &err)

isNew := ss.ID == uuid.Nil
if err := s.r.SessionPersister().UpsertSession(ctx, ss); err != nil {
return err
}
Expand All @@ -91,12 +86,6 @@ func (s *ManagerHTTP) UpsertAndIssueCookie(ctx context.Context, w http.ResponseW
return err
}

var event = events.NewSessionChanged
if isNew {
event = events.NewSessionIssued
}

trace.SpanFromContext(r.Context()).AddEvent(event(r.Context(), string(ss.AuthenticatorAssuranceLevel), ss.ID, ss.IdentityID))
return nil
}

Expand Down

0 comments on commit b1e78ad

Please sign in to comment.