X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fservices%2FAuthGuardService.ts;h=3e0ef8f78d4837edc2ba06c8f142fa179f28a301;hb=c84f1123f8ba69f9e2211b2d816bb415e595efaa;hp=2effecaea321bc0e160053672230c5bbcfb84495;hpb=a9816553feb848341a8c3214861d5479c3688578;p=osm%2FNG-UI.git diff --git a/src/services/AuthGuardService.ts b/src/services/AuthGuardService.ts index 2effeca..3e0ef8f 100644 --- a/src/services/AuthGuardService.ts +++ b/src/services/AuthGuardService.ts @@ -30,6 +30,7 @@ import { map } from 'rxjs/operators'; * @Injectable takes a metadata object that tells Angular how to compile and run module code */ @Injectable() +// eslint-disable-next-line deprecation/deprecation export class AuthGuardService implements CanActivate { /** Holds teh instance of AuthService class of type AuthService @private */ private router: Router; @@ -45,6 +46,7 @@ export class AuthGuardService implements CanActivate { * Returns Observable if authorized @public */ public canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + // eslint-disable-next-line deprecation/deprecation return combineLatest( this.authService.isLoggedIn, this.authService.isChangePassword @@ -53,7 +55,9 @@ export class AuthGuardService implements CanActivate { if (changePassword || isLoggedIn) { return true; } else { - this.router.navigate(['/login']).catch(); + this.router.navigate(['/login']).catch((): void => { + // Catch Navigation Error + }); this.authService.destoryToken(); return false; }