diff --git a/apps/portal/src/pages/login.vue b/apps/portal/src/pages/login.vue index 337a0759..11dbeef3 100644 --- a/apps/portal/src/pages/login.vue +++ b/apps/portal/src/pages/login.vue @@ -3,6 +3,8 @@ import authV1BottomShape from '@images/svg/auth-v1-bottom-shape.svg?raw' import authV1TopShape from '@images/svg/auth-v1-top-shape.svg?raw' import { VNodeRenderer } from '@layouts/components/VNodeRenderer' import { themeConfig } from '@themeConfig' +import { requiredValidator, emailValidator } from '@core/utils/validators' +import { VForm } from 'vuetify/components/VForm' import { useAuthStore } from '@/stores/useAuthStore' import { usePortalStore } from '@/stores/usePortalStore' import { apiClient } from '@/lib/axios' @@ -27,6 +29,7 @@ const form = ref({ password: '', }) +const refVForm = ref() const isPasswordVisible = ref(false) const errorMessage = ref('') const isSubmitting = ref(false) @@ -50,6 +53,9 @@ function mapLoginErrorMessage(message: string | undefined): string { } async function onSubmit(): Promise { + const { valid } = await refVForm.value!.validate() + if (!valid) return + errorMessage.value = '' isSubmitting.value = true @@ -209,7 +215,10 @@ function onMfaCancelled() { {{ errorMessage }} - + @@ -229,6 +239,7 @@ function onMfaCancelled() { placeholder="············" :type="isPasswordVisible ? 'text' : 'password'" autocomplete="current-password" + :rules="[requiredValidator]" :append-inner-icon="isPasswordVisible ? 'tabler-eye-off' : 'tabler-eye'" @click:append-inner="isPasswordVisible = !isPasswordVisible" />