Handle login redirect
This commit is contained in:
@ -10,15 +10,16 @@ import BudgetSidebar from '../pages/BudgetSidebar.vue';
|
||||
|
||||
const routes = [
|
||||
{ path: "/", name: "Index", component: Index },
|
||||
{ path: "/dashboard", name: "Dashboard", component: Dashboard },
|
||||
{ path: "/login", name: "Login", component: Login },
|
||||
{ path: "/register", name: "Register", component: Register },
|
||||
{ path: "/dashboard", name: "Dashboard", component: Dashboard, meta: { requiresAuth: true } },
|
||||
{ path: "/login", name: "Login", component: Login, meta: { hideForAuth: true } },
|
||||
{ path: "/register", name: "Register", component: Register, meta: { hideForAuth: true } },
|
||||
{ path: "/budget/:budgetid/budgeting", name: "Budget", redirect: (to : RouteLocationNormalized) =>
|
||||
'/budget/' + to.params.budgetid + '/budgeting/' + new Date().getFullYear() + '/' + new Date().getMonth()
|
||||
'/budget/' + to.params.budgetid + '/budgeting/' + new Date().getFullYear() + '/' + new Date().getMonth(),
|
||||
meta: { requiresAuth: true }
|
||||
},
|
||||
{ path: "/budget/:budgetid/budgeting/:year/:month", name: "Budget with date", components: { default: Budgeting, sidebar: BudgetSidebar }, props: true },
|
||||
{ path: "/budget/:budgetid/Settings", name: "Budget Settings", components: { default: Settings, sidebar: BudgetSidebar }, props: true },
|
||||
{ path: "/budget/:budgetid/account/:accountid", name: "Account", components: { default: Account, sidebar: BudgetSidebar }, props: true },
|
||||
{ path: "/budget/:budgetid/budgeting/:year/:month", name: "Budget with date", components: { default: Budgeting, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
|
||||
{ path: "/budget/:budgetid/Settings", name: "Budget Settings", components: { default: Settings, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
|
||||
{ path: "/budget/:budgetid/account/:accountid", name: "Account", components: { default: Account, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
|
Reference in New Issue
Block a user