From 38459965b4b31a95db81f71c5f38c56dc998762c Mon Sep 17 00:00:00 2001 From: niko <57009359+hauntii@users.noreply.github.com> Date: Mon, 21 Apr 2025 21:24:51 -0400 Subject: [PATCH] fix: redirect is computed --- src/pages/account/login/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index e16c927..f2a0e88 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -2,8 +2,8 @@ import { FetchError } from 'ofetch'; const route = useRoute(); -const redirect = route.query.redirect; -const registerURI = `/account/register${redirect ? `?redirect=${redirect}` : ''}`; +const redirect = computed(() => route.query.redirect); +const registerURI = computed(() => `/account/register${redirect.value ? `?redirect=${redirect.value}` : ''}`); const loginForm = reactive({ username: '', password: '' }); const errorMessage = ref(); @@ -21,8 +21,8 @@ async function loginSubmission() { return; }); - if (typeof redirect === 'string') { - await navigateTo(redirect); + if (typeof redirect.value === 'string') { + await navigateTo(redirect.value); } else { await navigateTo('/account'); }