From cce028d0a18c827d1b14cb4ad09d74788c876e14 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 20 Jul 2023 21:36:33 +0530 Subject: [PATCH] fix: added invalid page --- frontend/src/App.vue | 2 +- frontend/src/pages/InvalidPage.vue | 17 +++++++++++++++++ frontend/src/router.js | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/InvalidPage.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index ae737421..53d64c63 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -7,5 +7,5 @@ diff --git a/frontend/src/pages/InvalidPage.vue b/frontend/src/pages/InvalidPage.vue new file mode 100644 index 00000000..cd1a780c --- /dev/null +++ b/frontend/src/pages/InvalidPage.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontend/src/router.js b/frontend/src/router.js index a78ca2b1..18933e4d 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -26,6 +26,11 @@ const routes = [ name: 'Dashboard', component: () => import('@/pages/Dashboard.vue'), }, + { + path: '/:invalidpath', + name: 'Invalid Page', + component: () => import('@/pages/InvalidPage.vue'), + }, { path: '/login', name: 'Login', @@ -48,6 +53,8 @@ router.beforeEach(async (to, from, next) => { next({ name: 'Leads' }) } else if (to.name !== 'Login' && !session.isLoggedIn) { next({ name: 'Login' }) + } else if (to.matched.length === 0) { + next({ name: 'Invalid Page' }) } else { next() }