summaryrefslogtreecommitdiffstats
path: root/js/app/Config.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/app/Config.js')
-rw-r--r--js/app/Config.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/app/Config.js b/js/app/Config.js
index 830093351..2152615c6 100644
--- a/js/app/Config.js
+++ b/js/app/Config.js
@@ -33,12 +33,14 @@ app.config(function ($routeProvider, $provide, $httpProvider) {
$provide.factory('CSRFInterceptor', function ($q, BASE_URL, $window) {
return {
request: function (config) {
- var domain =
+ const token = $window.document.getElementsByTagName('head')[0]
+ .getAttribute('data-requesttoken');
+ const domain =
$window.location.href.split($window.location.pathname)[0];
if (config.url.indexOf(BASE_URL) === 0 ||
config.url.indexOf(domain) === 0) {
/*jshint camelcase: false */
- config.headers.requesttoken = oc_requesttoken;
+ config.headers.requesttoken = token;
}
return config || $q.when(config);