diff options
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r-- | web/app/controller/Root.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index b0067c01..adc188c0 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -37,11 +37,14 @@ Ext.define('Traccar.controller.Root', { 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] : ''; + tokenParameter = window.location.search.match('token=([a-zA-Z0-9]+)'); Ext.Ajax.request({ scope: this, - url: 'api/session' + tokenParameter, + url: 'api/session', + method: 'GET', + params: tokenParameter !== null ? { + token: tokenParameter[1] + } : {}, callback: this.onSessionReturn }); } else { |