]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix password displayed as username in Firefox password manager dialog
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 5 Jan 2018 01:45:34 +0000 (02:45 +0100)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 11 Jan 2018 15:33:38 +0000 (16:33 +0100)
When finishing the setup of Nextcloud through the WebUI (setting admin
user and database) Firefox offers to save the username and password.
However, the password was shown in both the username and password fields
of the Firefox password manager dialog.

The problem was that the password input element (in the HTML form) is
cloned in a text input element, which is used to show the password in
plain text when clicking on the "Show password" button. As it was a text
input immediately followed by a password input Firefox seemed to assume
that it had to be the username and ignored the real username field, no
matter the value set for the "autocomplete" attribute. Now the cloned
text input is added after the password input, so Firefox no longer
thinks that the cloned text input is the username field and the password
manager dialog shows the proper username instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
core/js/jquery-showpassword.js

index fc9de2170f98d595e351a17198b2e36db0776f1d..5d518c78bcbc0ca768cee14248e7bca178c63fc0 100644 (file)
@@ -74,7 +74,7 @@
                
                // Create clone
                                var $clone = cloneElement($input);
-                                       $clone.insertBefore($input);
+                                       $clone.insertAfter($input);
                                
                                // Set callback arguments
                if(callback.fn){