diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-03-03 21:51:29 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-03 21:51:29 +1300 |
commit | 50a2616002602c379f408d5ecc404a59d317b0ca (patch) | |
tree | 9fcd1689c19b474b49e4465706989c8818507e6f | |
parent | f6b43ed5b9ea619ab338a18c793cc9f2af126bf8 (diff) | |
parent | 9398715d10a9019cf1f1dbf682c93334d366a1c8 (diff) | |
download | trackermap-web-50a2616002602c379f408d5ecc404a59d317b0ca.tar.gz trackermap-web-50a2616002602c379f408d5ecc404a59d317b0ca.tar.bz2 trackermap-web-50a2616002602c379f408d5ecc404a59d317b0ca.zip |
Merge pull request #421 from Abyss777/fix_password_cookie
Save cookie credentials in base64
-rw-r--r-- | web/app/view/LoginController.js | 7 |
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'); |