Reuse UmbracoWebsiteSecurityAccessor.WebsiteSecurity and align with other templates, by saving in variable even if it is just used once.
+ Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -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 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
|
||||
|
||||
@if (UmbracoWebsiteSecurityAccessor.WebsiteSecurity.IsLoggedIn() && profileModel != null)
|
||||
@if (websiteSecurity.IsLoggedIn() && profileModel != null)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@*
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user