Files
start-os/web/projects/start-tunnel/src/app/app.routes.ts
2025-10-25 13:21:22 -06:00

18 lines
474 B
TypeScript

import { inject } from '@angular/core'
import { Routes } from '@angular/router'
import { AuthService } from 'src/app/services/auth.service'
export const routes: Routes = [
{
path: '',
loadChildren: () => import('./routes/home'),
canMatch: [() => inject(AuthService).authenticated()],
},
{
path: '',
loadComponent: () => import('./routes/login'),
canMatch: [() => !inject(AuthService).authenticated()],
},
{ path: '**', redirectTo: '' },
]