File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { NgModule } from '@angular/core' ;
2- import { RouterModule , NoPreloading } from '@angular/router' ;
2+ import { NoPreloading , RouterModule } from '@angular/router' ;
33import { AuthBlockingGuard } from './core/auth/auth-blocking.guard' ;
44
55import { AuthenticatedGuard } from './core/auth/authenticated.guard' ;
@@ -40,6 +40,7 @@ import {
4040import { ServerCheckGuard } from './core/server-check/server-check.guard' ;
4141import { MenuResolver } from './menu.resolver' ;
4242import { ThemedPageErrorComponent } from './page-error/themed-page-error.component' ;
43+ import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard' ;
4344
4445@NgModule ( {
4546 imports : [
@@ -94,7 +95,10 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
9495 path : FORGOT_PASSWORD_PATH ,
9596 loadChildren : ( ) => import ( './forgot-password/forgot-password.module' )
9697 . then ( ( m ) => m . ForgotPasswordModule ) ,
97- canActivate : [ EndUserAgreementCurrentUserGuard ]
98+ canActivate : [
99+ ForgotPasswordCheckGuard ,
100+ EndUserAgreementCurrentUserGuard
101+ ]
98102 } ,
99103 {
100104 path : COMMUNITY_MODULE_PATH ,
Original file line number Diff line number Diff line change 1+ import { Injectable } from '@angular/core' ;
2+ import { ActivatedRouteSnapshot , Router , RouterStateSnapshot } from '@angular/router' ;
3+ import { Observable , of } from 'rxjs' ;
4+ import { AuthorizationDataService } from '../data/feature-authorization/authorization-data.service' ;
5+ import { FeatureID } from '../data/feature-authorization/feature-id' ;
6+ import {
7+ SingleFeatureAuthorizationGuard
8+ } from '../data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard' ;
9+ import { AuthService } from '../auth/auth.service' ;
10+
11+ @Injectable ( {
12+ providedIn : 'root'
13+ } )
14+ /**
15+ * Guard that checks if the forgot-password feature is enabled
16+ */
17+ export class ForgotPasswordCheckGuard extends SingleFeatureAuthorizationGuard {
18+
19+ constructor (
20+ protected readonly authorizationService : AuthorizationDataService ,
21+ protected readonly router : Router ,
22+ protected readonly authService : AuthService
23+ ) {
24+ super ( authorizationService , router , authService ) ;
25+ }
26+
27+ getFeatureID ( route : ActivatedRouteSnapshot , state : RouterStateSnapshot ) : Observable < FeatureID > {
28+ return of ( FeatureID . EPersonForgotPassword ) ;
29+ }
30+
31+ }
You can’t perform that action at this time.
0 commit comments