openerp.auth_signup function sets self to login_mode default instead of singup

Bug #1244958 reported by Yurif
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
New
Undecided
Unassigned

Bug Description

When a user which is not yet registered clicks a sing up link from an email (something which ends in someithing like "#action=login&token=SomeToken&type=signup") he very often gets the login mask instead of the sign up mask. Re-clicking the link a few times eventually brings up the sign up mask.

I don't know why this happens but it looks like the problem is somewhere in the openerp.auth_signup function:

if (dbname) {
 self.rpc("/auth_signup/get_config", {dbname: dbname}).done(function(result) {
  self.signup_enabled = result.signup;
  self.reset_password_enabled = result.reset_password;
  if (!self.signup_enabled || self.$("form input[name=login]").val()) {
   self.set('login_mode', 'default');
  } else {
   self.set('login_mode', 'signup');
  }
 });
} else {
 self.set('login_mode', 'default');
}

In this part from the openerp.auth_signup function the first
   self.set('login_mode', 'default');
is triggered as self.signup_enabled is false as debugging showed me.

I haven't digged further as I think it would take me very long to understand why this happens also the page gets visited by a signup link which also clearly gets recognized by the function as for a short time or in debbuning mode with break points you see that first the correct sign up mask is set and then gets 'resetted' at the above shown line of code to the login mask.

Revision history for this message
Yurif (yurif) wrote :

By the way, if someone is looking for a quick workaround, adding the following code in auth_signup.js after the if clause shown above worked for me:

 var currentUrlHash = window.location.hash;
 if(currentUrlHash.indexOf("token=") != -1 && currentUrlHash.indexOf("type=signup") != -1){
   self.set('login_mode', 'signup');
 }

It doesn't really address the problem but is functional and shouldn't bring up new unwanted problems.

Revision history for this message
Scribder (scribder) wrote :

Hi Dear Yurif,

Please the bug is described here, the patch in this bug is working fine for me, and by inspecting the lines, it seems its a good way to do it :

https://bugs.launchpad.net/openobject-addons/+bug/1162914

Thanks,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.