Skip to content

Instantly share code, notes, and snippets.

@laniltee
Created October 26, 2018 16:15
Show Gist options
  • Save laniltee/23118de8e65593b6b10e7c7a446f5ff6 to your computer and use it in GitHub Desktop.
Save laniltee/23118de8e65593b6b10e7c7a446f5ff6 to your computer and use it in GitHub Desktop.
token cookie
<script>
function getTokenAndInject() {
const CSRF_TOKEN = Cookies.get('csrf-token');
$("#contentForm").append(
`<input type="text" hidden name="inputToken" id="inputToken" value=${CSRF_TOKEN} />`
)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment