From 4a35c231f885120fd4b2b2fac46d145b2b6f6254 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 30 Oct 2019 20:38:33 -0500 Subject: [PATCH] Always store CSRF token for each page in Vue.js theme so child components don't have to "redefine" it. at least, those that know about the page already having it... --- tailbone/templates/page.mako | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tailbone/templates/page.mako b/tailbone/templates/page.mako index 14c8b1a6..1dbd333b 100644 --- a/tailbone/templates/page.mako +++ b/tailbone/templates/page.mako @@ -35,7 +35,10 @@ methods: {} } - let ThisPageData = {} + let ThisPageData = { + ## TODO: should find a better way to handle CSRF token + csrftoken: ${json.dumps(request.session.get_csrf_token() or request.session.new_csrf_token())|n}, + }