aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/LoginController.js15
1 files changed, 4 insertions, 11 deletions
diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js
index 7a78a6fb1..47fae59f9 100644
--- a/web/app/view/LoginController.js
+++ b/web/app/view/LoginController.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,13 +26,6 @@ Ext.define('Traccar.view.LoginController', {
this.lookupReference('registerButton').setDisabled(
!Traccar.app.getServer().get('registration'));
this.lookupReference('languageField').setValue(Locale.language);
- var user = Ext.util.Cookies.get('user');
- var password = Ext.util.Cookies.get('password');
- if (user && password) {
- this.lookupReference('userField').setValue(user);
- this.lookupReference('passwordField').setValue(password);
- this.login();
- }
},
login: function () {
@@ -47,9 +40,9 @@ Ext.define('Traccar.view.LoginController', {
callback: function (options, success, response) {
Ext.getBody().unmask();
if (success) {
- if (this.lookupReference('rememberField').getValue()) {
+ if (this.lookupReference('rememberMeField').getValue()) {
Ext.util.Cookies.set('user', this.lookupReference('userField').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
- Ext.util.Cookies.set('password', this.lookupReference('passwordField').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
+ Ext.util.Cookies.set('pass', this.lookupReference('passwordField').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
}
Traccar.app.setUser(Ext.decode(response.responseText));
this.fireViewEvent('login');
@@ -63,7 +56,7 @@ Ext.define('Traccar.view.LoginController', {
logout: function () {
Ext.util.Cookies.clear('user');
- Ext.util.Cookies.clear('password');
+ Ext.util.Cookies.clear('pass');
Ext.Ajax.request({
scope: this,
method: 'DELETE',