aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-18 16:06:02 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-18 16:06:02 +0500
commitc6d8d7646a06e2624a0dac48b93fd5b1dd0db146 (patch)
treecd248c84222c7d22f133b27b6e4769cadca01857 /web/app/controller
parenta252dbe43512c75afd4a17075b834f767576fd28 (diff)
downloadtrackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.tar.gz
trackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.tar.bz2
trackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.zip
Implement users tokens
Diffstat (limited to 'web/app/controller')
-rw-r--r--web/app/controller/Root.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 568b761d..b0067c01 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -34,11 +34,14 @@ Ext.define('Traccar.controller.Root', {
},
onServerReturn: function (options, success, response) {
+ var tokenParameter;
if (success) {
Traccar.app.setServer(Ext.decode(response.responseText));
+ tokenParameter = window.location.search.match('/token=([a-zA-Z0-9]+)/');
+ tokenParameter = tokenParameter !== null ? '?' + tokenParameter[0] : '';
Ext.Ajax.request({
scope: this,
- url: 'api/session',
+ url: 'api/session' + tokenParameter,
callback: this.onSessionReturn
});
} else {