From 635a456fa4dede17edb644cd28ff14293866d523 Mon Sep 17 00:00:00 2001 From: Jo Date: Wed, 22 Feb 2023 13:31:08 +0000 Subject: [PATCH] Authn: Add separate context for session tagging (#63561) add context --- pkg/services/authn/clients/anonymous.go | 2 +- pkg/services/contexthandler/contexthandler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/authn/clients/anonymous.go b/pkg/services/authn/clients/anonymous.go index 84f2c7a7f30..3ca4083d6c3 100644 --- a/pkg/services/authn/clients/anonymous.go +++ b/pkg/services/authn/clients/anonymous.go @@ -46,7 +46,7 @@ func (a *Anonymous) Authenticate(ctx context.Context, r *authn.Request) (*authn. a.log.Warn("tag anon session panic", "err", err) } }() - if err := a.anonSessionService.TagSession(ctx, r.HTTPRequest); err != nil { + if err := a.anonSessionService.TagSession(context.Background(), r.HTTPRequest); err != nil { a.log.Warn("Failed to tag anonymous session", "error", err) } }() diff --git a/pkg/services/contexthandler/contexthandler.go b/pkg/services/contexthandler/contexthandler.go index c3dac19a650..b2fc142de9f 100644 --- a/pkg/services/contexthandler/contexthandler.go +++ b/pkg/services/contexthandler/contexthandler.go @@ -243,7 +243,7 @@ func (h *ContextHandler) initContextWithAnonymousUser(reqContext *contextmodel.R reqContext.Logger.Warn("tag anon session panic", "err", err) } }() - if err := h.anonSessionService.TagSession(reqContext.Req.Context(), reqContext.Req); err != nil { + if err := h.anonSessionService.TagSession(context.Background(), reqContext.Req); err != nil { reqContext.Logger.Warn("Failed to tag anonymous session", "error", err) } }()