Created
July 30, 2018 15:55
-
-
Save mattdfloyd/5ea86f8e6ffe73c90a31d777a2a41948 to your computer and use it in GitHub Desktop.
CSRF Token Component
This file contains hidden or 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
<template> | |
<input type="hidden" name="_token" :value="token"> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
token: null, | |
} | |
}, | |
mounted() { | |
this.token = document.head.querySelector('meta[name="csrf-token"]') | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment