Fix bug on repeatedly opening login form

Bug can be reproduced like this : 
- click on "login"
- click on "cancel" on the login form to close it
  (or click aside of the login form to close it) 
- click on "login" to open the login form again 
- Login form fails to open...