[FIX] web: never cache the CSRF token

"website.layout" inherit of "portal.frontend_layout" which inherit of
"web.layout" which contains the creation of the CSRF token.
Add because "website.layout" add a t-cache key, the CSRF token is under
this cache key. But the CSRF token should be always generated,
then add t-nocache on CSRF token t-set.

Part-of: odoo/odoo#95755
This commit is contained in:
Rémy Voet (ryv)
2022-08-10 14:43:07 +02:00
parent 75e1d93344
commit ef35a33300
+1 -1
View File
@@ -15,7 +15,7 @@
<link type="image/x-icon" rel="shortcut icon" t-att-href="x_icon or '/web/static/img/favicon.ico'"/>
<script id="web.layout.odooscript" type="text/javascript">
var odoo = {
csrf_token: "<t t-esc="request.csrf_token(None)"/>",
csrf_token: "<t t-nocache="The csrf token must always be up to date." t-esc="request.csrf_token(None)"/>",
debug: "<t t-esc="debug"/>",
};
</script>