Skip to content

Commit

Permalink
Autocomplete attribute on login, register and password_reset (#100)
Browse files Browse the repository at this point in the history
* fix(autocomplete): use autocomplete attribute to signal password managers what kind of password to use

* format: restored original formatting

* Remove autocomplete=off from login,register,reset_password

---------

Co-authored-by: Kevin Chung <[email protected]>
  • Loading branch information
janic0 and ColdHeat authored Jan 31, 2025
1 parent 6e79bf3 commit 7382ca5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ <h1>
{% endif %}

{% with form = Forms.auth.LoginForm() %}
<form method="post" accept-charset="utf-8" autocomplete="off">
<form method="post" accept-charset="utf-8">
<div class="mb-3">
<b>{{ form.name.label(class="form-label") }}</b>
{{ form.name(class="form-control", value=name) }}
{{ form.name(class="form-control", value=name, autocomplete="username email") }}
</div>

<div class="mb-3">
<b>{{ form.password.label(class="form-label") }}</b>
{{ form.password(class="form-control", value=password) }}
{{ form.password(class="form-control", value=password, autocomplete="current-password") }}
</div>

<div class="row pt-3">
Expand Down
8 changes: 4 additions & 4 deletions templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ <h1>

{% from "macros/forms.html" import render_extra_fields %}

<form method="post" accept-charset="utf-8" autocomplete="off" role="form">
<form method="post" accept-charset="utf-8" role="form">

<div class="mb-3">
<b>{{ form.name.label(class="form-label") }}</b>
{{ form.name(class="form-control", value=name) }}
{{ form.name(class="form-control", value=name, autocomplete="username") }}
<small class="form-text text-muted">
{% trans %}Your username on the site{% endtrans %}
</small>
</div>

<div class="mb-3">
<b>{{ form.email.label(class="form-label") }}</b>
{{ form.email(class="form-control", value=email) }}
{{ form.email(class="form-control", value=email, autocomplete="email") }}
<small class="form-text text-muted">
{% trans %}Never shown to the public{% endtrans %}
</small>
</div>

<div class="mb-3">
<b>{{ form.password.label(class="form-label") }}</b>
{{ form.password(class="form-control", value=password) }}
{{ form.password(class="form-control", value=password, autocomplete="new-password") }}
<small class="form-text text-muted">
{% trans %}Password used to log into your account{% endtrans %}
</small>
Expand Down
4 changes: 2 additions & 2 deletions templates/reset_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ <h1>

{% if mode == "set" %}
{% with form = Forms.auth.ResetPasswordForm() %}
<form method="post" accept-charset="utf-8" autocomplete="off" role="form" class="form-horizontal">
<form method="post" accept-charset="utf-8" role="form" class="form-horizontal">
<p>
{% trans %}You can now reset the password for your account and log in. Please enter in a new password below.{% endtrans %}
</p>

<div class="mb-3">
{{ form.password.label(class="form-label") }}
{{ form.password(class="form-control") }}
{{ form.password(class="form-control", autocomplete="new-password") }}
</div>

<div class="row pt-3">
Expand Down

0 comments on commit 7382ca5

Please sign in to comment.