diff options
| author | 2013-08-11 22:24:52 +0200 | |
|---|---|---|
| committer | 2013-08-11 22:24:52 +0200 | |
| commit | 8b1ea13b2df7e5cafb86e1689704ba749fb5e027 (patch) | |
| tree | cd1cfac93260cd4c657c5868c44c0aea6950fe89 | |
| parent | fixed account removing (diff) | |
| download | pyload-8b1ea13b2df7e5cafb86e1689704ba749fb5e027.tar.xz | |
fixed login for some clients
| -rw-r--r-- | pyload/web/api_app.py | 7 | ||||
| -rw-r--r-- | pyload/web/app/scripts/views/loginView.js | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py index c88be0519..b13e3bed9 100644 --- a/pyload/web/api_app.py +++ b/pyload/web/api_app.py @@ -102,7 +102,12 @@ def login(): result = BaseEncoder().default(user) result["session"] = sid - return dumps(result) + + # Return full user information if needed + if request.params.get('user', None): + return dumps(result) + + return dumps(sid) @route("/api/logout") diff --git a/pyload/web/app/scripts/views/loginView.js b/pyload/web/app/scripts/views/loginView.js index 9c96f625b..6c67a3408 100644 --- a/pyload/web/app/scripts/views/loginView.js +++ b/pyload/web/app/scripts/views/loginView.js @@ -18,8 +18,11 @@ define(['jquery', 'backbone', 'underscore', 'app', 'hbs!tpl/login'], e.stopPropagation(); var self = this; + var data = this.ui.form.serialize(); + // Load user representation + data.user = 'true'; var options = App.apiRequest('login', null, { - data: this.ui.form.serialize(), + data: data, type: 'post', success: function(data) { console.log('User logged in', data); |
