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:
parent
32edef2d38
commit
f4efdaa5de
@ -42,6 +42,10 @@ const props = defineProps({
|
|||||||
modelValue: String,
|
modelValue: String,
|
||||||
// This prop is a workaround to trigger validation from the outside when the user never had focus in the input.
|
// This prop is a workaround to trigger validation from the outside when the user never had focus in the input.
|
||||||
validateInitially: Boolean,
|
validateInitially: Boolean,
|
||||||
|
validateMinLength: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['submit', 'update:modelValue'])
|
const emit = defineEmits(['submit', 'update:modelValue'])
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
@ -62,12 +66,12 @@ const validate = useDebounceFn(() => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password.value.length < 8) {
|
if (props.validateMinLength && password.value.length < 8) {
|
||||||
isValid.value = t('user.auth.passwordNotMin')
|
isValid.value = t('user.auth.passwordNotMin')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password.value.length > 250) {
|
if (props.validateMinLength && password.value.length > 250) {
|
||||||
isValid.value = t('user.auth.passwordNotMax')
|
isValid.value = t('user.auth.passwordNotMax')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
v-model="password"
|
v-model="password"
|
||||||
tabindex="2"
|
tabindex="2"
|
||||||
:validate-initially="validatePasswordInitially"
|
:validate-initially="validatePasswordInitially"
|
||||||
|
:validate-min-length="false"
|
||||||
@submit="submit"
|
@submit="submit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user