Adds profile and settings pages
This commit is contained in:
@@ -11,6 +11,7 @@ import type { SetupStatus } from '@/api/types';
|
||||
import { api } from '@/lib/api-client';
|
||||
import { AppLayout } from '@/components/layout/AppLayout';
|
||||
import { LoginPage } from '@/pages/LoginPage';
|
||||
import { NotFoundPage } from '@/pages/NotFoundPage';
|
||||
import { RoleGuard } from '@/components/auth/RoleGuard';
|
||||
|
||||
export interface RouterContext {
|
||||
@@ -92,6 +93,7 @@ function lazyPage<P extends Record<string, never>>(
|
||||
const rootRoute = createRootRouteWithContext<RouterContext>()({
|
||||
pendingComponent: BootstrapSplash,
|
||||
pendingMs: 0,
|
||||
notFoundComponent: NotFoundPage,
|
||||
beforeLoad: async ({ location }) => {
|
||||
let status: SetupStatus;
|
||||
try {
|
||||
@@ -205,11 +207,18 @@ const profileRoute = createRoute({
|
||||
component: lazyPage(() => import('@/pages/ProfilePage'), 'ProfilePage'),
|
||||
});
|
||||
|
||||
const accessDeniedRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: '/403',
|
||||
component: lazyPage(() => import('@/pages/AccessDeniedPage'), 'AccessDeniedPage'),
|
||||
});
|
||||
|
||||
export const routeTree = rootRoute.addChildren([
|
||||
indexRoute,
|
||||
loginRoute,
|
||||
setupRoute,
|
||||
inviteCompleteRoute,
|
||||
accessDeniedRoute,
|
||||
authenticatedRoute.addChildren([dashboardRoute, usersRoute, cmsRoute, settingsRoute, profileRoute]),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user