feat(a11y): use autocomplete='new-password' on register form

Adds autocomplete prop to Password component (defaults to
'current-password'). Register page passes 'new-password' so
password managers offer to generate a strong password.

Fixes WCAG 1.3.5 (Identify Input Purpose).
This commit is contained in:
kolaente 2026-04-12 14:16:53 +02:00 committed by kolaente
parent 21b7ae3f9f
commit a34c247611
2 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,7 @@
:placeholder="$t('user.auth.passwordPlaceholder')"
required
:type="passwordFieldType"
autocomplete="current-password"
:autocomplete="autocomplete"
:tabindex="tabindex"
@keyup.enter="e => $emit('submit', e)"
@focusout="() => {validate(); validateAfterFirst = true}"
@ -44,9 +44,11 @@ const props = withDefaults(defineProps<{
// This prop is a workaround to trigger validation from the outside when the user never had focus in the input.
validateInitially?: boolean,
validateMinLength?: boolean,
autocomplete?: string,
}>(), {
tabindex: undefined,
validateMinLength: true,
autocomplete: 'current-password',
})
const emit = defineEmits<{

View File

@ -47,6 +47,7 @@
>{{ $t('user.auth.password') }}</label>
<Password
:validate-initially="validatePasswordInitially"
autocomplete="new-password"
@submit="submit"
@update:modelValue="v => credentials.password = v"
/>