From bb217f7e5d1faf2af345c7cd269fbe951603c2d5 Mon Sep 17 00:00:00 2001 From: Karl Persson Date: Tue, 28 Feb 2023 11:08:56 +0100 Subject: [PATCH] AuthN: Only mark IsSignedIn if user is not anonymous (#63833) Contexthandler: Only mark IsSignedIn if user is not anonymous --- pkg/services/contexthandler/contexthandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/contexthandler/contexthandler.go b/pkg/services/contexthandler/contexthandler.go index b2fc142de9f..302ab8de371 100644 --- a/pkg/services/contexthandler/contexthandler.go +++ b/pkg/services/contexthandler/contexthandler.go @@ -150,9 +150,9 @@ func (h *ContextHandler) Middleware(next http.Handler) http.Handler { // Hack: set all errors on LookupTokenErr, so we can check it in auth middlewares reqContext.LookupTokenErr = err } else { - reqContext.IsSignedIn = true reqContext.UserToken = identity.SessionToken reqContext.SignedInUser = identity.SignedInUser() + reqContext.IsSignedIn = !identity.IsAnonymous reqContext.AllowAnonymous = identity.IsAnonymous reqContext.IsRenderCall = identity.AuthModule == login.RenderModule }