mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
Use route guards from jslib to reduce duplication
This commit is contained in:
@@ -7,9 +7,10 @@ import {
|
||||
} from '@angular/router';
|
||||
|
||||
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
||||
import { LockGuardService } from 'jslib/angular/services/lock-guard.service';
|
||||
|
||||
import { LaunchGuardService } from './services/launch-guard.service';
|
||||
import { LockGuardService } from './services/lock-guard.service';
|
||||
import { NotPrivateGuardService } from './services/not-private-guard.service';
|
||||
import { UnauthGuardService } from './services/unauth-guard.service';
|
||||
|
||||
import { EnvironmentComponent } from './accounts/environment.component';
|
||||
import { HintComponent } from './accounts/hint.component';
|
||||
@@ -65,13 +66,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'home' },
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
component: LoginComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'login' },
|
||||
},
|
||||
{
|
||||
@@ -83,19 +84,19 @@ const routes: Routes = [
|
||||
{
|
||||
path: '2fa',
|
||||
component: TwoFactorComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: '2fa' },
|
||||
},
|
||||
{
|
||||
path: '2fa-options',
|
||||
component: TwoFactorOptionsComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: '2fa-options' },
|
||||
},
|
||||
{
|
||||
path: 'sso',
|
||||
component: SsoComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'sso' },
|
||||
},
|
||||
{
|
||||
@@ -106,19 +107,19 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'register',
|
||||
component: RegisterComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'register' },
|
||||
},
|
||||
{
|
||||
path: 'hint',
|
||||
component: HintComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'hint' },
|
||||
},
|
||||
{
|
||||
path: 'environment',
|
||||
component: EnvironmentComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: [NotPrivateGuardService, UnauthGuardService],
|
||||
data: { state: 'environment' },
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user