Add business registration for customers, owner panel, role-based nav, and Montime branding.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-1
@@ -41,6 +41,12 @@ const router = createRouter({
|
||||
component: () => import('@/views/app/AppProfileView.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/app/register-business',
|
||||
name: 'app-register-business',
|
||||
component: () => import('@/views/app/AppRegisterBusinessView.vue'),
|
||||
meta: { requiresAuth: true, requiresCustomer: true },
|
||||
},
|
||||
{
|
||||
path: '/app/owner',
|
||||
name: 'app-owner',
|
||||
@@ -54,7 +60,7 @@ const router = createRouter({
|
||||
router.beforeEach(async (to) => {
|
||||
const auth = useAuthStore();
|
||||
|
||||
if (auth.token && !auth.user) {
|
||||
if (auth.token) {
|
||||
await auth.loadUser();
|
||||
}
|
||||
|
||||
@@ -66,6 +72,10 @@ router.beforeEach(async (to) => {
|
||||
return { name: 'app-home' };
|
||||
}
|
||||
|
||||
if (to.meta.requiresCustomer && !auth.isCustomer) {
|
||||
return auth.isBusinessOwner ? { name: 'app-owner' } : { name: 'app-home' };
|
||||
}
|
||||
|
||||
if (to.meta.guest && auth.isLoggedIn) {
|
||||
return { name: 'app-home' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user