diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/EditProfile.cshtml
index d7639ff09f..de5f3167b0 100644
--- a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/EditProfile.cshtml
+++ b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/EditProfile.cshtml
@@ -5,7 +5,8 @@
@inject IUmbracoWebsiteSecurityAccessor UmbracoWebsiteSecurityAccessor
@{
- var profileModel = await UmbracoWebsiteSecurityAccessor.WebsiteSecurity.GetCurrentMemberProfileModelAsync();
+ var websiteSecurity = UmbracoWebsiteSecurityAccessor.WebsiteSecurity;
+ var profileModel = await websiteSecurity.GetCurrentMemberProfileModelAsync();
var success = TempData["ProfileUpdateSuccess"] != null;
@@ -15,7 +16,7 @@
-@if (UmbracoWebsiteSecurityAccessor.WebsiteSecurity.IsLoggedIn() && profileModel != null)
+@if (websiteSecurity.IsLoggedIn() && profileModel != null)
{
if (success)
{
diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/LoginStatus.cshtml b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/LoginStatus.cshtml
index 350f573ade..72f5e814c8 100644
--- a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/LoginStatus.cshtml
+++ b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/LoginStatus.cshtml
@@ -6,7 +6,8 @@
@inject IUmbracoWebsiteSecurityAccessor UmbracoWebsiteSecurityAccessor
@{
- var loginStatusModel = await UmbracoWebsiteSecurityAccessor.WebsiteSecurity.GetCurrentLoginStatusAsync();
+ var websiteSecurity = UmbracoWebsiteSecurityAccessor.WebsiteSecurity;
+ var loginStatusModel = await websiteSecurity.GetCurrentLoginStatusAsync();
var logoutModel = new PostRedirectModel();
@*
diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
index 9bbf630a21..0876e64b08 100644
--- a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
+++ b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
@@ -12,7 +12,8 @@
var registerModel = Members.CreateRegistrationModel("Custom Member");
*@
- var registerModel = UmbracoWebsiteSecurityAccessor.WebsiteSecurity.CreateRegistrationModel();
+ var websiteSecurity = UmbracoWebsiteSecurityAccessor.WebsiteSecurity;
+ var registerModel = websiteSecurity.CreateRegistrationModel();
@*
Configurable here: