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,
|
||||
// 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
|
||||
}
|
||||
|
@ -66,6 +66,7 @@
|
||||
v-model="password"
|
||||
tabindex="2"
|
||||
:validate-initially="validatePasswordInitially"
|
||||
:validate-min-length="false"
|
||||
@submit="submit"
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user