Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ts
diff options
context:
space:
mode:
authorsualko <klaus@jsxc.org>2020-05-15 18:20:49 +0300
committersualko <klaus@jsxc.org>2020-05-15 18:20:49 +0300
commit85898799f29248e9160e18ea2787d4476c90a9ca (patch)
treef881769423a98ce805b04e9ca47daebaec8dd878 /ts
parent9e88e80918535e06bcdbe1a7227f8f0547989b3a (diff)
fix: add csrf tokens to jsxc requests
Diffstat (limited to 'ts')
-rw-r--r--ts/Bootstrap.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/ts/Bootstrap.ts b/ts/Bootstrap.ts
index a31432d..14b3a26 100644
--- a/ts/Bootstrap.ts
+++ b/ts/Bootstrap.ts
@@ -51,6 +51,13 @@ export default class Bootstrap {
return;
}
+ JSXC.jQuery(document).on('ajaxSend', function(_elm, xhr, settings) {
+ if (settings.crossDomain === false) {
+ xhr.setRequestHeader('requesttoken', OC.requestToken);
+ xhr.setRequestHeader('OCS-APIREQUEST', 'true');
+ }
+ });
+
this.initJSXC();
this.addWatcher();
this.addAlternativeLogin();