Skip to content

Commit

Permalink
Add meta guard to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Sep 25, 2024
1 parent fec53f5 commit c07da8a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
9 changes: 8 additions & 1 deletion app/assets/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ const AdminDashboardRoutes = [
{
path: 'dashboard',
name: 'admin.dashboard',
meta: {
auth: {
redirect: { name: 'account.login' },
}
},
component: () => import('../views/DashboardView.vue')
}
]
Expand Down Expand Up @@ -118,7 +123,7 @@ const AdminUsersRoutes = [
}
]

export default [
const AdminRoutes = [
...AdminDashboardRoutes,
...AdminActivitiesRoutes,
...AdminGroupsRoutes,
Expand All @@ -127,6 +132,8 @@ export default [
...AdminUsersRoutes,
]

export default AdminRoutes

export {
AdminDashboardRoutes,
AdminActivitiesRoutes,
Expand Down
18 changes: 16 additions & 2 deletions dist/router/routes.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
declare const AdminDashboardRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/DashboardView.vue")>;
}[];
declare const AdminActivitiesRoutes: {
Expand Down Expand Up @@ -111,10 +118,17 @@ declare const AdminUsersRoutes: {
component: () => Promise<typeof import("../views/UserView.vue")>;
}[];
}[];
declare const _default: {
declare const AdminRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/DashboardView.vue")>;
}[];
export default _default;
export default AdminRoutes;
export { AdminDashboardRoutes, AdminActivitiesRoutes, AdminGroupsRoutes, AdminPermissionsRoutes, AdminRolesRoutes, AdminUsersRoutes };
2 changes: 1 addition & 1 deletion dist/routes.cjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",component:()=>Promise.resolve().then(()=>require("./DashboardView-CZ2sKm5M.cjs"))}],o=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-kaWFEO4i.cjs"))}],t=[{path:"groups",name:"admin.groups",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./GroupsView-BI4KKM8s.cjs")),children:[{path:"g/:slug",name:"account.group",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./GroupView-BrWTling.cjs"))}]}],n=[{path:"permissions",name:"admin.permissions",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./PermissionsView-ftOWB-4K.cjs")),children:[{path:"p/:id",name:"account.permission",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./PermissionView-CUKDO1AM.cjs"))}]}],r=[{path:"roles",name:"admin.roles",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./RolesView-ByDmJ9us.cjs")),children:[{path:"r/:slug",name:"account.role",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./RoleView-CWK0-zrt.cjs"))}]}],s=[{path:"users",name:"admin.users",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./UsersView-C0bG-VhA.cjs")),children:[{path:"u/:user_name",name:"account.user",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./UserView-BeTp1kMD.cjs"))}]}],i=[...e,...o,...t,...n,...r,...s];exports.AdminActivitiesRoutes=o;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=t;exports.AdminPermissionsRoutes=n;exports.AdminRolesRoutes=r;exports.AdminUsersRoutes=s;exports.default=i;
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./DashboardView-CZ2sKm5M.cjs"))}],t=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-kaWFEO4i.cjs"))}],n=[{path:"groups",name:"admin.groups",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./GroupsView-BI4KKM8s.cjs")),children:[{path:"g/:slug",name:"account.group",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./GroupView-BrWTling.cjs"))}]}],o=[{path:"permissions",name:"admin.permissions",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./PermissionsView-ftOWB-4K.cjs")),children:[{path:"p/:id",name:"account.permission",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./PermissionView-CUKDO1AM.cjs"))}]}],r=[{path:"roles",name:"admin.roles",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./RolesView-ByDmJ9us.cjs")),children:[{path:"r/:slug",name:"account.role",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./RoleView-CWK0-zrt.cjs"))}]}],s=[{path:"users",name:"admin.users",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./UsersView-C0bG-VhA.cjs")),children:[{path:"u/:user_name",name:"account.user",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./UserView-BeTp1kMD.cjs"))}]}],i=[...e,...t,...n,...o,...r,...s];exports.AdminActivitiesRoutes=t;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=n;exports.AdminPermissionsRoutes=o;exports.AdminRolesRoutes=r;exports.AdminUsersRoutes=s;exports.default=i;
5 changes: 5 additions & 0 deletions dist/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ const e = [
{
path: "dashboard",
name: "admin.dashboard",
meta: {
auth: {
redirect: { name: "account.login" }
}
},
component: () => import("./DashboardView-BbtHCt79.js")
}
], t = [
Expand Down

0 comments on commit c07da8a

Please sign in to comment.