[SECARSP-110][SECARSP-112] Registration/login/logout components are implemented
[platform/core/security/suspicious-activity-monitor.git] / dashboard / src / app / app-routing.module.ts
1 import { ExtraOptions, RouterModule, Routes } from '@angular/router';
2 import { NgModule } from '@angular/core';
3 import { AuthGuardService } from './@core/auth/auth-guard.service';
4 import {
5   NbAuthComponent,
6   NbRegisterComponent,
7   NbLoginComponent,
8 } from '@nebular/auth';
9
10 const routes: Routes = [
11   {
12     path: 'home',
13     canActivate: [AuthGuardService],
14     loadChildren: 'app/pages/pages.module#PagesModule',
15   },
16   {
17     path: 'auth',
18     component: NbAuthComponent,
19     children: [
20       {
21         path: '',
22         component: NbLoginComponent,
23       },
24       {
25         path: 'login',
26         component: NbLoginComponent,
27       },
28       {
29         path: 'register',
30         component: NbRegisterComponent,
31       },
32     ],
33   },
34   { path: '', redirectTo: 'home', pathMatch: 'full' },
35   { path: '**', redirectTo: 'home' },
36 ];
37
38 const config: ExtraOptions = {
39   useHash: true,
40 };
41
42 @NgModule({
43   imports: [RouterModule.forRoot(routes, config)],
44   exports: [RouterModule],
45 })
46 export class AppRoutingModule {
47 }