aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-03 09:33:51 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-03 09:33:51 +0500
commit9398715d10a9019cf1f1dbf682c93334d366a1c8 (patch)
tree9fcd1689c19b474b49e4465706989c8818507e6f /web/app
parentf6b43ed5b9ea619ab338a18c793cc9f2af126bf8 (diff)
downloadtrackermap-web-9398715d10a9019cf1f1dbf682c93334d366a1c8.tar.gz
trackermap-web-9398715d10a9019cf1f1dbf682c93334d366a1c8.tar.bz2
trackermap-web-9398715d10a9019cf1f1dbf682c93334d366a1c8.zip
Encode user and password to base64
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/LoginController.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js
index 436a1532..9e8e8352 100644
--- a/web/app/view/LoginController.js
+++ b/web/app/view/LoginController.js
@@ -40,11 +40,14 @@ Ext.define('Traccar.view.LoginController', {
url: 'api/session',
params: form.getValues(),
callback: function (options, success, response) {
+ var user, password;
Ext.get('spinner').setVisible(false);
if (success) {
if (this.lookupReference('rememberField').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));
+ user = Ext.util.Base64.encode(this.lookupReference('userField').getValue());
+ password = Ext.util.Base64.encode(this.lookupReference('passwordField').getValue());
+ Ext.util.Cookies.set('user', user, Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
+ Ext.util.Cookies.set('password', password, Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
}
Traccar.app.setUser(Ext.decode(response.responseText));
this.fireViewEvent('login');