1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

auth guard service to routes

This commit is contained in:
Kyle Spearrin
2018-02-08 11:12:25 -05:00
parent 2030100631
commit 6452cfaf7f
3 changed files with 38 additions and 2 deletions

View File

@@ -4,6 +4,8 @@ import {
Routes,
} from '@angular/router';
import { AuthGuardService } from './services/auth-guard.service';
import { HintComponent } from './accounts/hint.component';
import { LoginComponent } from './accounts/login.component';
import { RegisterComponent } from './accounts/register.component';
@@ -11,11 +13,15 @@ import { TwoFactorComponent } from './accounts/two-factor.component';
import { VaultComponent } from './vault/vault.component';
const routes: Routes = [
{ path: '', redirectTo: '/login', pathMatch: 'full' },
{ path: '', redirectTo: '/vault', pathMatch: 'full' },
{ path: 'login', component: LoginComponent },
{ path: '2fa', component: TwoFactorComponent },
{ path: 'register', component: RegisterComponent },
{ path: 'vault', component: VaultComponent },
{
path: 'vault',
component: VaultComponent,
canActivate: [AuthGuardService]
},
{ path: 'hint', component: HintComponent },
];