Skip to content

Commit 4e3b538

Browse files
CarlSchwanJulien VeyssierPytal
authored andcommitted
Add autocompletion for password reset
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 #27885 Signed-off-by: Carl Schwan <carl@carlschwan.eu> Co-Authored-By: Julien Veyssier <eneiluj@posteo.net> Co-Authored-By: Pytal <24800714+Pytal@users.noreply.github.com>
1 parent a8aeaa6 commit 4e3b538

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

apps/settings/templates/settings/personal/security/password.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
4242
<input type="password" id="pass1" name="oldpassword"
4343
placeholder="<?php p($l->t('Current password'));?>"
44-
autocomplete="off" autocapitalize="none" autocorrect="off" />
44+
autocomplete="current-password" autocapitalize="none" autocorrect="off" />
4545

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

core/src/components/login/LoginForm.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
v-model="user"
6060
type="text"
6161
name="user"
62-
autocapitalize="off"
62+
autocapitalize="none"
63+
autocorrect="off"
6364
:autocomplete="autoCompleteAllowed ? 'on' : 'off'"
6465
:placeholder="t('core', 'Username or email')"
6566
:aria-label="t('core', 'Username or email')"
@@ -75,7 +76,9 @@
7576
:type="passwordInputType"
7677
class="password-with-toggle"
7778
name="password"
78-
:autocomplete="autoCompleteAllowed ? 'on' : 'off'"
79+
autocorrect="off"
80+
autocapitalize="none"
81+
:autocomplete="autoCompleteAllowed ? 'current-password' : 'off'"
7982
:placeholder="t('core', 'Password')"
8083
:aria-label="t('core', 'Password')"
8184
required>

core/src/components/login/UpdatePassword.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
v-model="password"
3030
type="password"
3131
name="password"
32+
autocomplete="new-password"
33+
autocapitalize="none"
34+
autocorrect="off"
3235
required
3336
:placeholder="t('core', 'New password')">
3437
</p>

0 commit comments

Comments
 (0)