From 92ae4b96983b087939fb609eab184812226b3de3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Aug 2023 09:12:10 +0200 Subject: [PATCH] Bug 34369: Pass csrf token from syspref API client (for Vue app) Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Matt Blenkinsop --- .../prog/js/vue/fetch/system-preferences-api-client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js index 9e08afe8cf..9155ad2f01 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js @@ -16,7 +16,11 @@ export class SysprefAPIClient extends HttpClient { update: (variable, value) => this.post({ endpoint: "", - body: "pref_%s=%s".format(variable, value), + body: "pref_%s=%s&csrf_token=%s".format( + variable, + value, + csrf_token + ), headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", -- 2.39.2