fix(password): don't validate password min length on login page

This would cause the login to fail when the actual password was shorter than 8 characters.
This commit is contained in:
kolaente 2024-02-17 21:07:35 +01:00
parent 32edef2d38
commit f4efdaa5de
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 7 additions and 2 deletions

View File

@ -42,6 +42,10 @@ const props = defineProps({
modelValue: String,
// This prop is a workaround to trigger validation from the outside when the user never had focus in the input.
validateInitially: Boolean,
validateMinLength: {
type: Boolean,
default: true,
},
})
const emit = defineEmits(['submit', 'update:modelValue'])
const {t} = useI18n()
@ -62,12 +66,12 @@ const validate = useDebounceFn(() => {
return
}
if (password.value.length < 8) {
if (props.validateMinLength && password.value.length < 8) {
isValid.value = t('user.auth.passwordNotMin')
return
}
if (password.value.length > 250) {
if (props.validateMinLength && password.value.length > 250) {
isValid.value = t('user.auth.passwordNotMax')
return
}

View File

@ -66,6 +66,7 @@
v-model="password"
tabindex="2"
:validate-initially="validatePasswordInitially"
:validate-min-length="false"
@submit="submit"
/>
</div>