2018-06-05 05:10:41 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import {
|
|
|
|
RouterModule,
|
|
|
|
Routes,
|
|
|
|
} from '@angular/router';
|
|
|
|
|
2018-06-08 23:08:19 +02:00
|
|
|
import { FrontendLayoutComponent } from './layouts/frontend-layout.component';
|
|
|
|
import { OrganizationLayoutComponent } from './layouts/organization-layout.component';
|
|
|
|
import { UserLayoutComponent } from './layouts/user-layout.component';
|
|
|
|
|
2018-06-05 21:02:53 +02:00
|
|
|
import { HintComponent } from './accounts/hint.component';
|
2018-06-09 19:59:09 +02:00
|
|
|
import { LockComponent } from './accounts/lock.component';
|
2018-06-05 21:02:53 +02:00
|
|
|
import { LoginComponent } from './accounts/login.component';
|
|
|
|
import { RegisterComponent } from './accounts/register.component';
|
|
|
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
|
|
|
|
2018-06-21 04:27:37 +02:00
|
|
|
import { AccountComponent } from './settings/account.component';
|
2018-07-02 23:09:53 +02:00
|
|
|
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
2018-06-26 05:16:59 +02:00
|
|
|
import { DomainRulesComponent } from './settings/domain-rules.component';
|
2018-06-25 22:44:06 +02:00
|
|
|
import { OptionsComponent } from './settings/options.component';
|
2018-06-21 04:27:37 +02:00
|
|
|
import { SettingsComponent } from './settings/settings.component';
|
2018-06-27 04:51:58 +02:00
|
|
|
import { TwoFactorSetupComponent } from './settings/two-factor-setup.component';
|
2018-06-28 20:05:04 +02:00
|
|
|
import { UserBillingComponent } from './settings/user-billing.component';
|
2018-06-21 04:27:37 +02:00
|
|
|
|
2018-06-28 17:58:33 +02:00
|
|
|
import { BreachReportComponent } from './tools/breach-report.component';
|
2018-06-10 05:33:12 +02:00
|
|
|
import { ExportComponent } from './tools/export.component';
|
|
|
|
import { ImportComponent } from './tools/import.component';
|
2018-06-21 00:16:20 +02:00
|
|
|
import { PasswordGeneratorComponent } from './tools/password-generator.component';
|
2018-06-10 05:33:12 +02:00
|
|
|
import { ToolsComponent } from './tools/tools.component';
|
|
|
|
|
2018-06-05 05:10:41 +02:00
|
|
|
import { VaultComponent } from './vault/vault.component';
|
|
|
|
|
2018-06-10 04:02:45 +02:00
|
|
|
import { UnauthGuardService } from './services/unauth-guard.service';
|
|
|
|
|
|
|
|
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
|
|
|
|
2018-06-05 05:10:41 +02:00
|
|
|
const routes: Routes = [
|
|
|
|
{
|
2018-06-08 23:08:19 +02:00
|
|
|
path: '',
|
2018-06-10 04:02:45 +02:00
|
|
|
component: FrontendLayoutComponent,
|
2018-06-08 23:08:19 +02:00
|
|
|
children: [
|
2018-06-10 04:02:45 +02:00
|
|
|
{ path: '', pathMatch: 'full', component: LoginComponent, canActivate: [UnauthGuardService] },
|
|
|
|
{ path: '2fa', component: TwoFactorComponent, canActivate: [UnauthGuardService] },
|
|
|
|
{ path: 'register', component: RegisterComponent, canActivate: [UnauthGuardService] },
|
|
|
|
{ path: 'hint', component: HintComponent, canActivate: [UnauthGuardService] },
|
|
|
|
{ path: 'lock', component: LockComponent },
|
2018-06-08 23:08:19 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '',
|
2018-06-10 04:02:45 +02:00
|
|
|
component: UserLayoutComponent,
|
2018-06-08 23:08:19 +02:00
|
|
|
children: [
|
2018-06-10 04:02:45 +02:00
|
|
|
{ path: 'vault', component: VaultComponent, canActivate: [AuthGuardService] },
|
2018-06-21 04:27:37 +02:00
|
|
|
{
|
|
|
|
path: 'settings',
|
|
|
|
component: SettingsComponent,
|
|
|
|
children: [
|
|
|
|
{ path: '', pathMatch: 'full', redirectTo: 'account' },
|
|
|
|
{ path: 'account', component: AccountComponent, canActivate: [AuthGuardService] },
|
2018-06-25 22:44:06 +02:00
|
|
|
{ path: 'options', component: OptionsComponent, canActivate: [AuthGuardService] },
|
2018-06-26 05:16:59 +02:00
|
|
|
{ path: 'domain-rules', component: DomainRulesComponent, canActivate: [AuthGuardService] },
|
2018-06-27 04:51:58 +02:00
|
|
|
{ path: 'two-factor', component: TwoFactorSetupComponent, canActivate: [AuthGuardService] },
|
2018-06-28 20:05:04 +02:00
|
|
|
{ path: 'billing', component: UserBillingComponent, canActivate: [AuthGuardService] },
|
2018-07-02 23:09:53 +02:00
|
|
|
{
|
|
|
|
path: 'create-organization',
|
|
|
|
component: CreateOrganizationComponent,
|
|
|
|
canActivate: [AuthGuardService],
|
|
|
|
},
|
2018-06-21 04:27:37 +02:00
|
|
|
],
|
|
|
|
},
|
2018-06-10 05:33:12 +02:00
|
|
|
{
|
|
|
|
path: 'tools',
|
|
|
|
component: ToolsComponent,
|
|
|
|
children: [
|
2018-06-21 00:16:20 +02:00
|
|
|
{ path: '', pathMatch: 'full', redirectTo: 'generator' },
|
2018-06-10 05:33:12 +02:00
|
|
|
{ path: 'import', component: ImportComponent, canActivate: [AuthGuardService] },
|
|
|
|
{ path: 'export', component: ExportComponent, canActivate: [AuthGuardService] },
|
2018-06-21 00:16:20 +02:00
|
|
|
{ path: 'generator', component: PasswordGeneratorComponent, canActivate: [AuthGuardService] },
|
2018-06-28 17:58:33 +02:00
|
|
|
{ path: 'breach-report', component: BreachReportComponent, canActivate: [AuthGuardService] },
|
2018-06-10 05:33:12 +02:00
|
|
|
],
|
|
|
|
},
|
2018-06-08 23:08:19 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'organization/:organizationId',
|
|
|
|
component: OrganizationLayoutComponent,
|
|
|
|
children: [
|
2018-06-10 04:02:45 +02:00
|
|
|
{ path: 'vault', component: VaultComponent, canActivate: [AuthGuardService] },
|
2018-06-08 23:08:19 +02:00
|
|
|
],
|
2018-06-05 05:10:41 +02:00
|
|
|
},
|
2018-06-08 23:08:19 +02:00
|
|
|
{ path: '**', redirectTo: '' },
|
2018-06-05 05:10:41 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [RouterModule.forRoot(routes, {
|
|
|
|
useHash: true,
|
|
|
|
/*enableTracing: true,*/
|
|
|
|
})],
|
|
|
|
exports: [RouterModule],
|
|
|
|
})
|
|
|
|
export class AppRoutingModule { }
|