SecurityToken IsAnonymousUser inconsistent

Hi.

We have a scenario when SecurityToken.IsAnonymousUser is set to true when a user is logged in and visiting the category page, how can this be possible?

It is set to false in the same session for other pages.

I see no difference when debugging Thread.CurrentPrincipal.Identity

Litium version: 7.7.1

Hi, I had a similar issue in a project. The issue was that PageModelBuilder was registred as a singleton, which caused the injected security context to be “Captive dependency” in that singleton.

[Service(Lifetime = DependencyLifetime.Singleton)]
public abstract class PageModelBuilder<T> : IViewModelBuilder<T>

Should be just
public abstract class PageModelBuilder : IViewModelBuilder

/Niclas

3 Likes

Thank you Niclas, that did the trick!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.