Commit c24e6c6f authored by Maxime REYROLLE's avatar Maxime REYROLLE

add guard to routes

parent e93e72ba
Pipeline #1296 passed with stage
in 23 minutes and 45 seconds
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {ConnectorListComponent} from './connector-list/connector-list.component';
import {ConnectorFormComponent} from './connector-form/connector-form.component';
import {ConnectorComponent} from './connector/connector.component';
import {AuthenticationGuard} from '../authentication/guard/authentication.guard';
const routes: Routes = [
{
path: 'connectors',
children: [
canActivate: [AuthenticationGuard],
children: [
{
path: '',
component: ConnectorListComponent,
......@@ -42,4 +44,5 @@ const routes: Routes = [
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ConnectorsRoutingModule { }
export class ConnectorsRoutingModule {
}
......@@ -4,11 +4,13 @@ import {Routes, RouterModule} from '@angular/router';
import {LocalGovernmentListComponent} from './local-government-list/local-government-list.component';
import {LocalGovernmentComponent} from './local-government/local-government.component';
import {LocalGovernmentFormComponent} from './local-government-form/local-government-form.component';
import {AuthenticationGuard} from '../authentication/guard/authentication.guard';
const routes: Routes = [
{
path: 'local_governments',
children: [
canActivate: [AuthenticationGuard],
children: [
{
path: '',
component: LocalGovernmentListComponent,
......
......@@ -4,10 +4,12 @@ import {Routes, RouterModule} from '@angular/router';
import {SubscriptionListComponent} from './subscription-list/subscription-list.component';
import {SubscriptionFormComponent} from './subscription-form/subscription-form.component';
import {SubscriptionComponent} from './subscription/subscription.component';
import {AuthenticationGuard} from '../authentication/guard/authentication.guard';
const routes: Routes = [
{
path: 'subscriptions',
canActivate: [AuthenticationGuard],
children: [
{
path: '',
......
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {UserListComponent} from './user-list/user-list.component';
import {UserComponent} from './user/user.component';
import {UserFormComponent} from './user-form/user-form.component';
import {AuthenticationGuard} from '../authentication/guard/authentication.guard';
const routes: Routes = [
{
path: 'users',
component: UserListComponent
},
{
path: 'users/add',
component: UserFormComponent
},
{
path: 'users/:id/edit',
component: UserFormComponent
},
{
path: 'users/:id',
component: UserComponent
canActivate: [AuthenticationGuard],
children: [
{
path: '',
component: UserListComponent
},
{
path: 'add',
component: UserFormComponent
},
{
path: ':id',
children: [
{
path: '',
component: UserComponent
},
{
path: 'edit',
component: UserFormComponent
},
]
},
]
},
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment