diff --git a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs index f45744b16d..c4290396b6 100644 --- a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs @@ -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;