* Fixes #11189 * Fixes #11183 * Fix test Null_When_No_Content_On_PublishedRequest. Believe this is reasonable. * Update src/Umbraco.Web.Website/Routing/PublicAccessRequestHandler.cs Co-authored-by: Paul Johnson <pmj@umbraco.com> Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Routing;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Web.Common.Security
|
||||
{
|
||||
@@ -34,6 +36,19 @@ namespace Umbraco.Cms.Web.Common.Security
|
||||
options.LogoutPath = null;
|
||||
|
||||
options.CookieManager = new MemberCookieManager(_runtimeState, _umbracoRequestPaths);
|
||||
|
||||
options.Events = new CookieAuthenticationEvents
|
||||
{
|
||||
OnSignedIn = ctx =>
|
||||
{
|
||||
// occurs when sign in is successful and after the ticket is written to the outbound cookie
|
||||
|
||||
// When we are signed in with the cookie, assign the principal to the current HttpContext
|
||||
ctx.HttpContext.SetPrincipalForRequest(ctx.Principal);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user