diff options
author | sualko <klaus@jsxc.org> | 2020-05-15 18:20:49 +0300 |
---|---|---|
committer | sualko <klaus@jsxc.org> | 2020-05-15 18:20:49 +0300 |
commit | 85898799f29248e9160e18ea2787d4476c90a9ca (patch) | |
tree | f881769423a98ce805b04e9ca47daebaec8dd878 /ts | |
parent | 9e88e80918535e06bcdbe1a7227f8f0547989b3a (diff) |
fix: add csrf tokens to jsxc requests
Diffstat (limited to 'ts')
-rw-r--r-- | ts/Bootstrap.ts | 7 |
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(); |