relocate the GetUser() call in App.razor so that it is not included in the Site cache
This commit is contained in:
@ -104,6 +104,12 @@ namespace Oqtane.Services
|
||||
}
|
||||
site.Languages = site.Languages.OrderBy(item => item.Name).ToList();
|
||||
|
||||
// get user
|
||||
if (_accessor.HttpContext.User.IsAuthenticated())
|
||||
{
|
||||
site.User = _userManager.GetUser(_accessor.HttpContext.User.UserId(), site.SiteId);
|
||||
}
|
||||
|
||||
return Task.FromResult(site);
|
||||
}
|
||||
|
||||
@ -149,12 +155,6 @@ namespace Oqtane.Services
|
||||
// themes
|
||||
site.Themes = _themes.FilterThemes(_themes.GetThemes(site.SiteId).ToList());
|
||||
|
||||
// user
|
||||
if (_accessor.HttpContext.User.IsAuthenticated())
|
||||
{
|
||||
site.User = _userManager.GetUser(_accessor.HttpContext.User.UserId(), site.SiteId);
|
||||
}
|
||||
|
||||
// installation date used for fingerprinting static assets
|
||||
site.Fingerprint = Utilities.GenerateSimpleHash(_configManager.GetSetting("InstallationDate", DateTime.UtcNow.ToString("yyyyMMddHHmm")));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user