Thread.CurrentPrincipal is null inside IsCachingAllowed
Hi,
I keep getting null reference exception as my CacheOutput attribute was not working on my .net core 3 app. Turns out the Thread.CurrentPrincipal is null on [.net core 3]https://github.com/dotnet/runtime/issues/29151)
Should we be using the workaround as tagged on the issue above? or change our Thread.CurrentPrincipal
Hi @prayatna,
I've hotfixed this in a separate branch. Please let me know if it works for you.
@Iamcerba Your hotfix null check solved the null reference exception issue however did not solve the underlying problem which is Thread.CurrentPrincipal was null for authorised users. I have a PR to fix it. https://github.com/Iamcerba/AspNetCore.CacheOutput/pull/13