File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {
4343import { ServerCheckGuard } from './core/server-check/server-check.guard' ;
4444import { MenuResolver } from './menu.resolver' ;
4545import { ThemedPageErrorComponent } from './page-error/themed-page-error.component' ;
46+ import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard' ;
4647import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths' ;
4748import { RedirectService } from './redirect/redirect.service' ;
4849
@@ -99,7 +100,10 @@ import { RedirectService } from './redirect/redirect.service';
99100 path : FORGOT_PASSWORD_PATH ,
100101 loadChildren : ( ) => import ( './forgot-password/forgot-password.module' )
101102 . then ( ( m ) => m . ForgotPasswordModule ) ,
102- canActivate : [ EndUserAgreementCurrentUserGuard ]
103+ canActivate : [
104+ ForgotPasswordCheckGuard ,
105+ EndUserAgreementCurrentUserGuard
106+ ]
103107 } ,
104108 {
105109 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