aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/controller/Root.js')
-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 568b761..b0067c0 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 {