Add authentication check to auth layout route
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user