summaryrefslogtreecommitdiff
path: root/addons/auth_signup/static
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2012-10-23 21:18:05 +0200
committerChristophe Simonis <chs@openerp.com>2012-10-23 21:18:05 +0200
commit9b1daf3861ff5f92da95a421b53487e3b4cbc17d (patch)
tree682d4d373457e0c745cad6b5ac4da6c0b1b70fc1 /addons/auth_signup/static
parentc03c830ba5d34e25964c031436524292138e2a9e (diff)
[FIX] auth_signup: do the signup via ajax, allowing web client to respect hash values and execute initially asked action
bzr revid: chs@openerp.com-20121023191805-6ct40v4klj75fdpx
Diffstat (limited to 'addons/auth_signup/static')
-rw-r--r--addons/auth_signup/static/src/js/auth_signup.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index 0974b73292d..bb249429894 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -8,12 +8,20 @@ openerp.auth_signup = function(instance) {
var d = this._super();
// to switch between the signup and regular login form
- this.$('a.oe_signup_signup').click(function() {
+ this.$('a.oe_signup_signup').click(function(ev) {
+ if (ev) {
+ ev.preventDefault();
+ }
self.$el.addClass("oe_login_signup");
+ return false;
});
- this.$('a.oe_signup_back').click(function() {
+ this.$('a.oe_signup_back').click(function(ev) {
+ if (ev) {
+ ev.preventDefault();
+ }
self.$el.removeClass("oe_login_signup");
delete self.params.token;
+ return false;
});
// if there is an error message in params, show it then forget it
@@ -90,10 +98,19 @@ openerp.auth_signup = function(instance) {
name: name,
login: login,
password: password,
- state: $.param(this.params)
+ //state: $.param(this.params)
};
- var url = "/auth_signup/signup?" + $.param(params);
- window.location = url;
+
+ var self = this,
+ super_ = this._super;
+ this.rpc('/auth_signup/signup', params)
+ .done(function(result) {
+ if (result.error) {
+ self.show_error(result.error);
+ } else {
+ super_.apply(self, [ev]);
+ }
+ });
} else {
// regular login
this._super(ev);