This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using System.Web.Helpers; | |
using Sitecore.XA.Foundation.Abstractions; | |
using Sitecore.XA.Foundation.Scriban.Pipelines.GenerateScribanContext; | |
using Scriban.Runtime; | |
namespace Sitecore.Foundation.ScribanExtensions.Scriban | |
{ | |
public class GetAntiforgeryToken : IGenerateScribanContextProcessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<sitecore> | |
<pipelines> | |
<generateScribanContext> | |
<processor type="Sitecore.Foundation.ScribanExtensions.Scriban.GetAntiforgeryToken, Sitecore.Foundation.ScribanExtensions" resolve="true" /> | |
</generateScribanContext> | |
</pipelines> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web.Helpers; | |
using System.Web.Mvc; | |
namespace Sitecore.Foundation.Forms.Validation | |
{ | |
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = true)] | |
public class ValidateFormAntiForgeryTokenAttribute : FilterAttribute, IAuthorizationFilter | |
{ | |
public void OnAuthorization(AuthorizationContext filterContext) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost, ValidateFormAntiForgeryToken] | |
public ActionResult Confirm(TextModel text) | |
{ | |
.... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formData = $('input[name="text"]').val(); | |
var token = $('input[name="__RequestVerificationToken"]').val(); | |
var headersData = {}; | |
headersData['__RequestVerificationToken'] = token; | |
$.ajax({ | |
url: url, | |
method: 'POST', | |
data: formData, | |
dataType: 'json', | |
contentType: 'application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"namespace": "Sitecore.Feature.Media", | |
"items": { | |
"includes": [ | |
{ | |
"name" : "Templates", | |
"path" : "/sitecore/templates/Feature/Media", | |
"scope": "ItemAndDescendants", | |
"allowedPushOperations": "CreateUpdateAndDelete" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<templatePredicate type="Leprechaun.InputProviders.Sitecore.Filters.SitecoreTemplatePredicate, Leprechaun.InputProviders.Sitecore" rootNamespace="$(layer).$(module)" singleInstance="true"> | |
<include name="Templates" /> | |
<include name="UserDefined" /> | |
<include name="SystemTemplates" /> | |
</templatePredicate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<services> | |
<configurator type="Feature.Serialization.DI.RegisterContainer, Feature.Serialization" /> | |
</services> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Feature.Serialization.DI | |
{ | |
using Feature.Serialization.Services; | |
using Microsoft.Extensions.DependencyInjection; | |
using Sitecore.DependencyInjection; | |
public class RegisterContainer : IServicesConfigurator | |
{ | |
public void Configure(IServiceCollection serviceCollection) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Feature.Serialization.Services | |
{ | |
using Sitecore.Data.Items; | |
using Sitecore.Data.Serialization; | |
public interface IItemSerializationService | |
{ | |
void DumpItem(Item item); | |
void DumpTree(Item item); | |
Item LoadItem(Item item, LoadOptions loadOptions); |