From 6a35c4affc242a911cae056f3a0600c56883dafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Mar 2024 20:57:03 -0400 Subject: [PATCH] refactor(pages): update login page navigate to the home page after successful login --- pages/auth/login.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/auth/login.vue b/pages/auth/login.vue index 5980f14..2d9a612 100644 --- a/pages/auth/login.vue +++ b/pages/auth/login.vue @@ -10,6 +10,7 @@ unauthenticatedOnly: true, navigateAuthenticatedTo: "/", }, + middleware: ["auth"], }); const formState = reactive({ @@ -23,6 +24,10 @@ let reso: any; try { reso = await signIn(values); + + await navigateTo({ + path: "/", + }); } catch (e: any) { if (e.data) { notification["error"]({ @@ -30,24 +35,20 @@ }); } } - - await navigateTo({ - path: "/", - }); };