Getting front end routing poc going

This commit is contained in:
Shannon
2020-12-08 16:33:50 +11:00
parent 7e4a6421d6
commit e3be4009c0
37 changed files with 543 additions and 315 deletions

View File

@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@@ -45,7 +45,7 @@ namespace Umbraco.Web.BackOffice.Middleware
if (cookieOptions == null)
throw new InvalidOperationException("No cookie options found with name " + Constants.Security.BackOfficeAuthenticationType);
//If we've gotten this far it means a preview cookie has been set and a front-end umbraco document request is executing.
// If we've gotten this far it means a preview cookie has been set and a front-end umbraco document request is executing.
// In this case, authentication will not have occurred for an Umbraco back office User, however we need to perform the authentication
// for the user here so that the preview capability can be authorized otherwise only the non-preview page will be rendered.
if (request.Cookies.TryGetValue(cookieOptions.Cookie.Name, out var cookie))
@@ -55,7 +55,7 @@ namespace Umbraco.Web.BackOffice.Middleware
{
var backOfficeIdentity = unprotected.Principal.GetUmbracoIdentity();
if (backOfficeIdentity != null)
//Ok, we've got a real ticket, now we can add this ticket's identity to the current
// Ok, we've got a real ticket, now we can add this ticket's identity to the current
// Principal, this means we'll have 2 identities assigned to the principal which we can
// use to authorize the preview and allow for a back office User.