@ -68,14 +74,37 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu
returnconfiguration;
}
configuration=(awaitCache.GetOrAddAsync(
varcached=awaitCache.GetAsync(cacheKey);
if(cached!=null)
{
if(httpContext!=null)
{
httpContext.Items[cacheKey]=cached;
}
returncached;
}
configuration=awaitGetRemoteConfigurationAsync();
// The cache key comes from ICurrentUser, but the access token comes from the HttpContext. A Blazor Server circuit can
// still run as the user after its request has ended, so the call goes without a token and gets an anonymous configuration.
if(!IsForCurrentUser(configuration))
{
Logger.LogWarning(
"Not caching the remote application configuration: it is for user {RemoteUserId} (authenticated: {RemoteIsAuthenticated}), not the current user {CurrentUserId}.",