Re introduce cookie check, but adding return statement

This commit is contained in:
Mole
2021-02-24 13:20:53 +01:00
parent 2fcae1cc28
commit 0a2efc252f

View File

@@ -44,6 +44,16 @@ namespace Umbraco.Cms.Web.BackOffice.Filters
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
if (context.Controller is ControllerBase controller && controller.User.Identity is ClaimsIdentity userIdentity)
{
// if there is not CookiePath claim, then exit
if (userIdentity.HasClaim(x => x.Type == ClaimTypes.CookiePath) == false)
{
await next();
return;
}
}
var cookieToken = _cookieManager.GetCookieValue(Constants.Web.CsrfValidationCookieName);
var httpContext = context.HttpContext;