HTML

html/password-autocomplete

Password fields say current-password (sign-in) or new-password (sign-up, change) in autocomplete, and never use autocomplete off.

umiarkowanastatycznefe-forms

Dlaczego

Password managers decide from autocomplete whether to fill a saved password or offer a new strong one. Without the token they guess, often wrongly (filling the old password into "new password"); autocomplete="off" tries to stop them altogether. People who rely on a manager instead of memory then cannot sign in easily, which is what WCAG 3.3.8 is about.

Poprawka

Use autocomplete="current-password" on sign-in and on the "current password" field of a change form, autocomplete="new-password" on sign-up and on the new password fields, and autocomplete="username" on the account field next to them. Allow paste.

Przykłady

<!-- bad -->
<input id="pw" name="password" type="password" autocomplete="off">
<!-- good -->
<input id="pw" name="password" type="password" autocomplete="current-password">

Źródła

Fakty

Identyfikator
html/password-autocomplete
Waga
umiarkowana
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html angular vue svelte astro jsx
Uczy jej skill
fe-forms Native forms and validation
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain html/password-autocomplete