Skip to content

Commit 3dc104a

Browse files
author
yaroslav8765
committed
fix: fix error message in console on the login page
1 parent 4a67771 commit 3dc104a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

adminforth/spa/src/views/LoginView.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
name="username"
5656
id="username"
5757
ref="usernameInput"
58-
oninput="setCustomValidity('')"
58+
@input="clearUsernameValidity"
5959
@keydown.enter="passwordInput.focus()"
6060
class="w-full"
6161
placeholder="[email protected]" required />
@@ -66,7 +66,7 @@
6666
v-model="password"
6767
ref="passwordInput"
6868
autocomplete="current-password"
69-
oninput="setCustomValidity('')"
69+
@input="clearPasswordValidity"
7070
@keydown.enter="login"
7171
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="w-full" required>
7272
<template #rightIcon>
@@ -141,8 +141,8 @@ import { useI18n } from 'vue-i18n';
141141
142142
const { t } = useI18n();
143143
144-
const passwordInput = ref(null);
145-
const usernameInput = ref(null);
144+
const passwordInput = ref<HTMLInputElement | null>(null)
145+
const usernameInput = ref<HTMLInputElement | null>(null)
146146
const rememberMeValue= ref(false);
147147
const username = ref('');
148148
const password = ref('');
@@ -162,6 +162,14 @@ const backgroundPosition = computed(() => {
162162
return coreStore.config?.loginBackgroundPosition || '1/2';
163163
});
164164
165+
function clearPasswordValidity() {
166+
passwordInput.value?.setCustomValidity('test')
167+
}
168+
169+
function clearUsernameValidity() {
170+
usernameInput.value?.setCustomValidity('test')
171+
}
172+
165173
onBeforeMount(() => {
166174
if (localStorage.getItem('isAuthorized') === 'true') {
167175
// if route has next param, redirect

0 commit comments

Comments
 (0)