2018-04-04 04:14:54 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import {
|
|
|
|
RouterModule,
|
|
|
|
Routes,
|
|
|
|
} from '@angular/router';
|
|
|
|
|
2018-04-05 04:59:42 +02:00
|
|
|
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
|
|
|
|
2018-04-04 16:08:30 +02:00
|
|
|
import { EnvironmentComponent } from './accounts/environment.component';
|
|
|
|
import { HintComponent } from './accounts/hint.component';
|
2018-04-04 20:19:44 +02:00
|
|
|
import { HomeComponent } from './accounts/home.component';
|
2018-04-05 04:59:42 +02:00
|
|
|
import { LockComponent } from './accounts/lock.component';
|
2018-04-04 04:14:54 +02:00
|
|
|
import { LoginComponent } from './accounts/login.component';
|
2018-04-04 16:08:30 +02:00
|
|
|
import { RegisterComponent } from './accounts/register.component';
|
|
|
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
|
|
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
2018-04-05 04:59:42 +02:00
|
|
|
import { TabsComponent } from './tabs.component';
|
2018-04-05 21:35:56 +02:00
|
|
|
import { CiphersComponent } from './vault/ciphers.component';
|
2018-04-05 04:59:42 +02:00
|
|
|
import { CurrentTabComponent } from './vault/current-tab.component';
|
|
|
|
import { GroupingsComponent } from './vault/groupings.component';
|
2018-04-06 05:09:49 +02:00
|
|
|
import { ViewComponent } from './vault/view.component';
|
2018-04-04 04:14:54 +02:00
|
|
|
|
|
|
|
const routes: Routes = [
|
2018-04-05 04:59:42 +02:00
|
|
|
{ path: '', redirectTo: '/tabs/current', pathMatch: 'full' },
|
|
|
|
{ path: 'vault', redirectTo: '/tabs/vault', pathMatch: 'full' },
|
|
|
|
{ path: 'home', component: HomeComponent },
|
2018-04-04 04:14:54 +02:00
|
|
|
{ path: 'login', component: LoginComponent },
|
2018-04-05 04:59:42 +02:00
|
|
|
{ path: 'lock', component: LockComponent },
|
2018-04-04 16:08:30 +02:00
|
|
|
{ path: '2fa', component: TwoFactorComponent },
|
|
|
|
{ path: '2fa-options', component: TwoFactorOptionsComponent },
|
|
|
|
{ path: 'register', component: RegisterComponent },
|
|
|
|
{ path: 'hint', component: HintComponent },
|
|
|
|
{ path: 'environment', component: EnvironmentComponent },
|
2018-04-05 21:35:56 +02:00
|
|
|
{ path: 'ciphers', component: CiphersComponent },
|
2018-04-06 05:09:49 +02:00
|
|
|
{ path: 'view-cipher', component: ViewComponent },
|
2018-04-05 04:59:42 +02:00
|
|
|
{
|
|
|
|
path: 'tabs', component: TabsComponent,
|
|
|
|
children: [
|
|
|
|
{ path: '', redirectTo: '/tabs/vault', pathMatch: 'full' },
|
|
|
|
{
|
|
|
|
path: 'current',
|
|
|
|
component: CurrentTabComponent,
|
|
|
|
canActivate: [AuthGuardService],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'vault',
|
|
|
|
component: GroupingsComponent,
|
|
|
|
canActivate: [AuthGuardService],
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2018-04-04 04:14:54 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [RouterModule.forRoot(routes, {
|
|
|
|
useHash: true,
|
|
|
|
/*enableTracing: true,*/
|
|
|
|
})],
|
|
|
|
exports: [RouterModule],
|
|
|
|
})
|
|
|
|
export class AppRoutingModule { }
|