Skip to content

Commit

Permalink
Add autocompletion for password reset
Browse files Browse the repository at this point in the history
Using autocomplete="current-password" and autocomplete="new-password"
will help browser with integrated password managers to generate safe
password for the users.

See https://developer.apple.com/documentation/security/password_autofill/enabling_password_autofill_on_an_html_input_element
and https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/password#allowing_autocomplete.

Also unify autocapitalize="none" autocorrect="off" behavior in a few
other places for password input fields.

Close nextcloud#27885

Signed-off-by: Carl Schwan <[email protected]>
Co-Authored-By: Julien Veyssier <[email protected]>
Co-Authored-By: Pytal <[email protected]>
  • Loading branch information
3 people authored and szaimen committed Jul 14, 2021
1 parent a8aeaa6 commit 55e149d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
<input type="password" id="pass1" name="oldpassword"
placeholder="<?php p($l->t('Current password'));?>"
autocomplete="off" autocapitalize="none" autocorrect="off" />
autocomplete="current-password" autocapitalize="none" autocorrect="off" />

<div class="personal-show-container">
<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
<input type="password" id="pass2" name="newpassword"
placeholder="<?php p($l->t('New password')); ?>"
data-typetoggle="#personal-show"
autocomplete="off" autocapitalize="none" autocorrect="off" />
autocomplete="new-password" autocapitalize="none" autocorrect="off" />
<input type="checkbox" id="personal-show" class="hidden-visually" name="show" /><label for="personal-show" class="personal-show-label"></label>
</div>

Expand Down
7 changes: 5 additions & 2 deletions core/src/components/login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
v-model="user"
type="text"
name="user"
autocapitalize="off"
autocapitalize="none"
autocorrect="off"
:autocomplete="autoCompleteAllowed ? 'on' : 'off'"
:placeholder="t('core', 'Username or email')"
:aria-label="t('core', 'Username or email')"
Expand All @@ -75,7 +76,9 @@
:type="passwordInputType"
class="password-with-toggle"
name="password"
:autocomplete="autoCompleteAllowed ? 'on' : 'off'"
autocorrect="off"
autocapitalize="none"
:autocomplete="autoCompleteAllowed ? 'current-password' : 'off'"
:placeholder="t('core', 'Password')"
:aria-label="t('core', 'Password')"
required>
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/login/UpdatePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
v-model="password"
type="password"
name="password"
autocomplete="new-password"
autocapitalize="none"
autocorrect="off"
required
:placeholder="t('core', 'New password')">
</p>
Expand Down

0 comments on commit 55e149d

Please sign in to comment.