refactor: move onboarding to dashboard routes

Doing this ensures that login checks are run for this page, coz we want this page to be accessible only to individuals who are logged in
This commit is contained in:
Shivam Mishra
2023-12-18 15:53:58 +05:30
parent f1484f1625
commit 2267d85b29
2 changed files with 11 additions and 0 deletions
@@ -35,16 +35,19 @@ export default {
{
path: frontendURL('start/setup-profile'),
name: 'onboarding_setup_profile',
roles: ['administrator'],
component: SetupProfile,
},
{
path: frontendURL('start/setup-company'),
name: 'onboarding_setup_company',
roles: ['administrator'],
component: SetupCompany,
},
{
path: frontendURL('start/founders-note'),
name: 'onboarding_founders_note',
roles: ['administrator'],
component: FoundersNote,
},
],
+8
View File
@@ -45,11 +45,19 @@ export const validateAuthenticateRoutePermission = (to, next, { getters }) => {
return next(frontendURL(`accounts/${user.account_id}/dashboard`));
}
// we can let them access onboarding routes
// we will eventually need guards as onboarding is done, but for now
// we can let them access onboarding routes
if (to.name.startsWith('onboarding')) {
return next();
}
const nextRoute = validateLoggedInRoutes(
to,
getters.getCurrentUser,
window.roleWiseRoutes
);
return nextRoute ? next(frontendURL(nextRoute)) : next();
};