summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2017-02-15 22:17:20 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2017-02-15 22:17:20 +0100
commit778b1e70142c5f5345aa5cc683385ace2dfa47bb (patch)
tree90551474b6de9ebbb22ed8623489e174430072ae
parent848a472f2025cd27bcdacdd04fe273a8ed3ead43 (diff)
parse request token from head element directly
-rw-r--r--composer.lock11
-rw-r--r--js/app/Config.js6
2 files changed, 9 insertions, 8 deletions
diff --git a/composer.lock b/composer.lock
index 3c98487d1..ad0c9bdd4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,6 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "2aeb3a6a1ab336d16bf352f4e88f6825",
"content-hash": "ef2350b58d0ee66262400727956c9786",
"packages": [
{
@@ -49,7 +48,7 @@
"keywords": [
"html"
],
- "time": "2016-07-16 12:58:58"
+ "time": "2016-07-16T12:58:58+00:00"
},
{
"name": "fguillot/picofeed",
@@ -102,7 +101,7 @@
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed",
- "time": "2016-12-29 00:06:41"
+ "time": "2016-12-29T00:06:41+00:00"
},
{
"name": "pear/net_url2",
@@ -163,7 +162,7 @@
"uri",
"url"
],
- "time": "2016-04-18 22:24:01"
+ "time": "2016-04-18T22:24:01+00:00"
},
{
"name": "riimu/kit-pathjoin",
@@ -208,7 +207,7 @@
"path",
"system"
],
- "time": "2015-08-22 11:29:24"
+ "time": "2015-08-22T11:29:24+00:00"
},
{
"name": "zendframework/zendxml",
@@ -253,7 +252,7 @@
"xml",
"zf2"
],
- "time": "2016-02-04 21:02:08"
+ "time": "2016-02-04T21:02:08+00:00"
}
],
"packages-dev": [],
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);