Bug 34369: Pass csrf token from syspref API client (for Vue app)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-08-01 09:12:10 +02:00 committed by Tomas Cohen Arazi
parent c6ef2aba6b
commit 3c6dd02acb
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 5 additions and 1 deletions

View File

@ -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",