8787 </div >
8888
8989 <component
90- v-for =" c in coreStore?.config?.loginPageInjections?.underInputs || []"
90+ v-for =" (c, index) in coreStore?.config?.loginPageInjections?.underInputs || []"
91+ :key =" `under-inputs-${index}`"
9192 :is =" getCustomComponent(formatComponent(c))"
9293 :meta =" formatComponent(c).meta"
9394 @update:disableLoginButton =" setDisableLoginButton($event)"
106107 {{ $t('Login to your account') }}
107108 </Button >
108109 <component
109- v-for =" c in coreStore?.config?.loginPageInjections?.underLoginButton || []"
110+ v-for =" (c, index) in coreStore?.config?.loginPageInjections?.underLoginButton || []"
111+ :key =" `under-login-button-${index}`"
110112 :is =" getCustomComponent(formatComponent(c))"
111113 :meta =" formatComponent(c).meta"
112114 @update:disableLoginButton =" setDisableLoginButton($event)"
125127<script setup lang="ts">
126128
127129import { getCustomComponent , formatComponent } from ' @/utils' ;
128- import { onBeforeMount , onMounted , ref , computed } from ' vue' ;
130+ import { onMounted , ref , computed } from ' vue' ;
129131import { useCoreStore } from ' @/stores/core' ;
130132import { useUserStore } from ' @/stores/user' ;
131133import { IconEyeSolid , IconEyeSlashSolid } from ' @iconify-prerendered/vue-flowbite' ;
132134import { callAdminForthApi , loadFile } from ' @/utils' ;
133- import { useRoute , useRouter } from ' vue-router' ;
135+ import { useRouter } from ' vue-router' ;
134136import { Button , Checkbox , Input } from ' @/afcl' ;
135- import { useI18n } from ' vue-i18n' ;
136137import ErrorMessage from ' @/components/ErrorMessage.vue' ;
137138
138- const { t } = useI18n ();
139-
140139const passwordInput = ref <InstanceType <typeof Input > | null >(null );
141140const usernameInput = ref <InstanceType <typeof Input > | null >(null );
142141const rememberMeValue= ref (false );
143142const username = ref (' ' );
144143const password = ref (' ' );
145144
146- const route = useRoute ();
147145const router = useRouter ();
148146const inProgress = ref <boolean >(false );
149147const isSuccess = ref <boolean >(false );
@@ -160,18 +158,6 @@ const backgroundPosition = computed(() => {
160158});
161159
162160
163- onBeforeMount (() => {
164- if (localStorage .getItem (' isAuthorized' ) === ' true' ) {
165- // if route has next param, redirect
166- coreStore .fetchMenuAndResource ();
167- if (route .query .next ) {
168- router .push (route .query .next .toString ());
169- } else {
170- router .push ({ name: ' home' });
171- }
172- }
173- })
174-
175161onMounted (async () => {
176162 coreStore .getLoginFormConfig ();
177163 if (coreStore .config ?.demoCredentials ) {
0 commit comments