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:
@@ -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,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user