Protect homepage with keycloak
This commit is contained in:
		
					parent
					
						
							
								a23a438a7e
							
						
					
				
			
			
				commit
				
					
						fa30fc3305
					
				
			
		
					 1 changed files with 9 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,13 +1,17 @@
 | 
				
			||||||
import { Routes } from '@angular/router';
 | 
					import {Routes} from '@angular/router';
 | 
				
			||||||
import {LandingPageComponent} from "./landing-page/landing-page.component";
 | 
					import {LandingPageComponent} from "./landing-page/landing-page.component";
 | 
				
			||||||
import {HomepageComponent} from "./homepage/homepage/homepage.component";
 | 
					import {HomepageComponent} from "./homepage/homepage/homepage.component";
 | 
				
			||||||
 | 
					import {authGuard} from "./auth.guard";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const routes: Routes = [
 | 
					export const routes: Routes = [
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: 'home',
 | 
					    path: '',
 | 
				
			||||||
    component: HomepageComponent
 | 
					    component: LandingPageComponent,
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    path: 'home',
 | 
				
			||||||
 | 
					    component: HomepageComponent,
 | 
				
			||||||
 | 
					    canActivate: [authGuard],
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					 | 
				
			||||||
  { path: '', component: LandingPageComponent }
 | 
					 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue