From c6d8d7646a06e2624a0dac48b93fd5b1dd0db146 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 18 Nov 2016 16:06:02 +0500 Subject: Implement users tokens --- web/app/controller/Root.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'web/app/controller') 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 { -- cgit v1.2.3