From 61509b794bc546db6c36fa832cd7cb4e8f21bb6d Mon Sep 17 00:00:00 2001 From: "Mr.Dat" Date: Mon, 5 Jan 2026 15:04:29 +0700 Subject: [PATCH] Add authentication check to auth layout route --- src/routes/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/routes/index.ts b/src/routes/index.ts index a4501f6..64beed0 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -32,6 +32,14 @@ const routes: RouteData[] = [ { path: "", component: () => import("./auth/layout.vue"), + beforeEnter: (to, from, next) => { + const auth = useAuthStore(); + if (auth.user) { + next({ name: "overview" }); + } else { + next(); + } + }, children: [ { path: "login",