diff --git a/app/pages/login.vue b/app/pages/login.vue index 1d8290c..670a712 100644 --- a/app/pages/login.vue +++ b/app/pages/login.vue @@ -6,6 +6,7 @@ definePageMeta({ }); const { fetch } = useUserSession(); const router = useRouter(); +const route = useRoute(); const localePath = useLocalePath(); const { isValid, resetValidation, validate } = useForm('formRef'); const validation = useValidation(); @@ -28,7 +29,15 @@ async function submit() { body: form }); await fetch(); - await router.push(localePath('/')); + await router.push( + localePath( + (route.query.to + ? typeof route.query.to === 'string' + ? route.query.to + : route.query.to[0] + : '/') || '/' + ) + ); return; } catch (e) { if (e instanceof Error && 'statusCode' in e && e.statusCode === 404) { @@ -118,7 +127,7 @@ async function submit() { $t('auth.login') }} {{ $t('auth.register_instead') }} {{ $t('auth.login_instead') }}