diff options
| author | Raphael Collet <rco@openerp.com> | 2012-09-28 16:21:03 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2012-09-28 16:21:03 +0200 |
| commit | ad2d3c360fcab3cf9d5121dd9bcaf1303b71befd (patch) | |
| tree | d6914e9d58f9bc14e90adf8d0c63dedd985c7328 /addons/auth_signup/static/src | |
| parent | c74ce161171dfbebbeb2d569914f165b8c1892d0 (diff) | |
[IMP] auth_signup: fallback to login when token is no longer valid but user exists
bzr revid: rco@openerp.com-20120928142103-3a4vbs7y3gw135qm
Diffstat (limited to 'addons/auth_signup/static/src')
| -rw-r--r-- | addons/auth_signup/static/src/js/auth_signup.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js index 9bc775c8355..509fafa35cc 100644 --- a/addons/auth_signup/static/src/js/auth_signup.js +++ b/addons/auth_signup/static/src/js/auth_signup.js @@ -31,20 +31,23 @@ openerp.auth_signup = function(instance) { return d; }, on_token_loaded: function(result) { - // switch to signup mode - this.$el.addClass("oe_login_signup"); // select the right the database this.selected_db = result.db; this.on_db_loaded({db_list: [result.db]}); - // set the name and login of user - this.$("form input[name=name]").val(result.name).attr("readonly", "readonly"); - if (result.login) { - this.$("form input[name=login]").val(result.login).attr("readonly", "readonly"); + if (result.token) { + // switch to signup mode, set user name and login + this.$el.addClass("oe_login_signup"); + this.$("form input[name=name]").val(result.name).attr("readonly", "readonly"); + if (result.login) { + this.$("form input[name=login]").val(result.login).attr("readonly", "readonly"); + } else { + this.$("form input[name=login]").val(result.email); + } } else { - this.$("form input[name=login]").val(result.email); + // remain in login mode, set login if present + delete this.params.token; + this.$("form input[name=login]").val(result.login || ""); } - this.$("form input[name=password]").val(""); - this.$("form input[name=confirm_password]").val(""); }, on_token_failed: function(result, ev) { if (ev) { |
