Fix password displayed as username in Firefox password manager dialog

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>
This commit is contained in:
Daniel Calviño Sánchez 2018-01-05 02:45:34 +01:00
parent 1f8896d8c9
commit 58d00bf6fb

View file

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