diff libervia/server/pages.py @ 1324:898442c4ff68

pages: expose `cache_path` to scripts + `session_uuid` to templates
author Goffi <goffi@goffi.org>
date Fri, 14 Aug 2020 09:06:56 +0200
parents a0954b6610aa
children 9bfd2d0661b2
line wrap: on
line diff
--- a/libervia/server/pages.py	Sun Aug 02 20:57:55 2020 +0200
+++ b/libervia/server/pages.py	Fri Aug 14 09:06:56 2020 +0200
@@ -1426,6 +1426,7 @@
         theme = session_data.theme or self.default_theme
         self.exposeToScripts(
             request,
+            cache_path=session_data.cache_dir,
             templates_root_url=str(self.vhost_root.getFrontURL(theme)),
             profile=session_data.profile)
 
@@ -1695,10 +1696,10 @@
             # if template_data doesn't exist, it's the beginning of the request workflow
             # so we fill essential data
             session_data = self.host.getSessionData(request, session_iface.ISATSession)
-            csrf_token = session_data.csrf_token
             request.template_data = {
                 "profile": session_data.profile,
-                "csrf_token": csrf_token,
+                "csrf_token": session_data.csrf_token,
+                "session_uuid": session_data.uuid,
             }
 
             # XXX: here is the code which need to be executed once