From 58d00bf6fb76327ecf972776d1736ec78f00848d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 5 Jan 2018 02:45:34 +0100 Subject: [PATCH] Fix password displayed as username in Firefox password manager dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- core/js/jquery-showpassword.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js index fc9de2170f..5d518c78bc 100644 --- a/core/js/jquery-showpassword.js +++ b/core/js/jquery-showpassword.js @@ -74,7 +74,7 @@ // Create clone var $clone = cloneElement($input); - $clone.insertBefore($input); + $clone.insertAfter($input); // Set callback arguments if(callback.fn){