From 5f59b2f27c8b9440c2319fcf6ecf83a24cdc690e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 25 Apr 2024 12:43:51 +0000 Subject: [PATCH] Bug 36700: Add CSRF token to the systemprefences POST Content-Type: text/plain; charset=utf-8 Test plan: Go to Admin/Preferences. Change value and Save. Signed-off-by: Marcel de Rooy --- .../prog/js/fetch/system-preferences-api-client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js index e2b9bcbac8..3a328c50d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js @@ -19,7 +19,7 @@ export class SysprefAPIClient extends HttpClient { body: "pref_%s=%s".format( encodeURIComponent(variable), encodeURIComponent(value) - ), + ).concat('&csrf_token=', this.csrf_token), headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", @@ -37,7 +37,7 @@ export class SysprefAPIClient extends HttpClient { : "%s=".format(variable) ) .flat(Infinity) - .join("&"), + .join("&").concat('&csrf_token=', this.csrf_token), headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", -- 2.30.2