diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2021-08-29 22:15:58 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2021-08-29 22:15:58 -0600 |
commit | 15ae483fadbd136acefcd602b2f2ac5a83165c73 (patch) | |
tree | 0f25ed1dd81e4fffeed6055dd02da48a567c8fb2 /static/src/assets/utils.js | |
parent | 5746a510fc569fd464e46b646d4979a976ad769b (diff) |
add CSRF checking
Diffstat (limited to 'static/src/assets/utils.js')
-rw-r--r-- | static/src/assets/utils.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/static/src/assets/utils.js b/static/src/assets/utils.js new file mode 100644 index 0000000..96a2950 --- /dev/null +++ b/static/src/assets/utils.js @@ -0,0 +1,12 @@ +const cookies = {}; +const cookieKVs = document.cookie + .split(';') + .map(cookie => cookie.trim().split('=', 2)); + +for (const i in cookieKVs) { + cookies[cookieKVs[i][0]] = cookieKVs[i][1]; +} + +export { + cookies, +} |