Skip to content

Instantly share code, notes, and snippets.

@ananth-iyer
ananth-iyer / CsrfValidatorSkip.php
Last active October 30, 2023 10:33
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
<?php
namespace Vendor\Module\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action
@EmmanuelOga
EmmanuelOga / commit-msg
Created June 13, 2012 22:01
commit-msg hook to add a prefix to commit messages
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "US1234-postfix", or
# "US1234_postfix", it automatically adds the prefix "[US1234]" to commit
# messages.
#
# Example
# =======
#
# git checkout -b US1234-some-cool-feature