AuthN: Only mark IsSignedIn if user is not anonymous (#63833)

Contexthandler: Only mark IsSignedIn if user is not anonymous
This commit is contained in:
Karl Persson
2023-02-28 11:08:56 +01:00
committed by GitHub
parent 526cac60e5
commit bb217f7e5d
@@ -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
}