133133
134134
135135<script setup lang="ts">
136- import { onMounted , ref , computed , Ref , onBeforeMount } from ' vue' ;
136+ import { onMounted , ref , computed , Ref , onBeforeMount , nextTick } from ' vue' ;
137137import { useCoreStore } from ' @/stores/core' ;
138138import { useUserStore } from ' @/stores/user' ;
139139import { callAdminForthApi , loadFile , applyRegexValidation } from ' @/utils' ;
140- import { useRoute , useRouter } from ' vue-router' ;
140+ import { onBeforeRouteUpdate , useRoute , useRouter } from ' vue-router' ;
141141import { IconEyeSolid , IconEyeSlashSolid } from ' @iconify-prerendered/vue-flowbite' ;
142142import Button from ' @/afcl/Button.vue' ;
143143import Link from ' @/afcl/Link.vue' ;
@@ -210,10 +210,6 @@ const validationError = computed(() => {
210210
211211const error: Ref <string | null > = ref (null );
212212
213- onMounted (async () => {
214- emailInput .value ?.focus ();
215- });
216-
217213
218214const backgroundPosition = computed (() => {
219215 return coreStore .config ?.loginBackgroundPosition || ' 1/2' ;
@@ -246,6 +242,7 @@ const passwordConstraints: Ref<{
246242// }
247243
248244onBeforeMount (() => {
245+ // console.log('⛔ SignUp Page. Before Mount: ', route)
249246 if (localStorage .getItem (' isAuthorized' ) === ' true' ) {
250247 // if route has next param, redirect
251248 coreStore .fetchMenuAndResource ();
@@ -258,15 +255,22 @@ onBeforeMount(() => {
258255})
259256
260257onMounted (async () => {
258+ emailInput .value ?.focus ();
259+ await coreStore .getPublicConfig ();
261260
261+ await nextTick ();
262+ await router .isReady ();
262263
263- await coreStore .getPublicConfig ();
264264 // getPasswordConstraints
265+ console .log (' ⛔ SignUp Page. Before Mount: ' , route .meta )
265266 passwordConstraints .value = await callAdminForthApi ({
266267 path: ` /plugin/${route .meta .pluginInstanceId }/password-constraints ` ,
267268 method: ' GET' ,
268269 });
269- });
270+ })
271+
272+ // onMounted(async () => {
273+ // });
270274
271275async function doSignup() {
272276 error .value = null ;
0 commit comments