Skip to content
Snippets Groups Projects
Select Git revision
  • 1686c9bace0cbe1773de8b3a72191c7de6c8ed2f
  • main default protected
  • Release_3
  • Release_2
  • microservices_split
  • Release_1
6 results

app.routes.ts

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    app.routes.ts 1.06 KiB
    import { UnauthorizedComponent } from './page/unauthorized/unauthorized.component';
    import { AppRoute } from './core/models/Route.interface';
    import { rolGuard, rolGuardChild } from '@core/guards';
    export const routes: AppRoute[] = [
      // Auth
      {
        path: '',
        loadChildren: () => import('./features/auth').then((m) => m.AUTH_ROUTES),
      },
      // Hoteles
      {
        path: 'hotels',
        loadChildren: () =>
          import('./features/hotels').then((m) => m.HOTELS_ROUTES),
      },
      // Usuario
      {
        path: 'me',
        canActivate: [rolGuard],
        canActivateChild: [rolGuardChild],
        loadChildren: () => import('./features/users').then((m) => m.USERS_ROUTES),
      },
      // Administrador
      {
        path: 'admin',
        canActivate: [rolGuard],
        canActivateChild: [rolGuardChild],
        data: { expectedRole: 'ADMIN' },
        loadChildren: () => import('./features/admin').then((m) => m.ADMIN_ROUTES),
      },
      // Página no autorizada
      {
        path: 'unauthorized',
        component: UnauthorizedComponent,
      },
      // {
      //   path: '**',
      //   redirectTo: '/login',
      //   pathMatch: 'full',
      // },
    ];