summaryrefslogtreecommitdiff
path: root/static/src/assets/utils.js
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2021-08-29 22:15:58 -0600
committerBrian Picciano <mediocregopher@gmail.com>2021-08-29 22:15:58 -0600
commit15ae483fadbd136acefcd602b2f2ac5a83165c73 (patch)
tree0f25ed1dd81e4fffeed6055dd02da48a567c8fb2 /static/src/assets/utils.js
parent5746a510fc569fd464e46b646d4979a976ad769b (diff)
add CSRF checking
Diffstat (limited to 'static/src/assets/utils.js')
-rw-r--r--static/src/assets/utils.js12
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,
+}