From f4efdaa5de598b1cd57c0c3b06addd189413e877 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 17 Feb 2024 21:07:35 +0100 Subject: [PATCH] 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. --- frontend/src/components/input/password.vue | 8 ++++++-- frontend/src/views/user/Login.vue | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/input/password.vue b/frontend/src/components/input/password.vue index d6812a5fc8..a3d9279335 100644 --- a/frontend/src/components/input/password.vue +++ b/frontend/src/components/input/password.vue @@ -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 } diff --git a/frontend/src/views/user/Login.vue b/frontend/src/views/user/Login.vue index 742249b283..33809d4abd 100644 --- a/frontend/src/views/user/Login.vue +++ b/frontend/src/views/user/Login.vue @@ -66,6 +66,7 @@ v-model="password" tabindex="2" :validate-initially="validatePasswordInitially" + :validate-min-length="false" @submit="submit" />