X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fservices%2FAuthenticationService.ts;h=5eda6f9c0d45ee2d8fa302a427b7eb1beda23e61;hb=0a34dfa32165036b380ec6ac493469b34007df0a;hp=0399c597a8ee944b368277985cecd2cca0c90389;hpb=40cc37ef2bbc4aac5debc9dea0baeb6dbd87a2d7;p=osm%2FNG-UI.git diff --git a/src/services/AuthenticationService.ts b/src/services/AuthenticationService.ts index 0399c59..5eda6f9 100644 --- a/src/services/AuthenticationService.ts +++ b/src/services/AuthenticationService.ts @@ -18,6 +18,7 @@ /** * @file Auth service */ +import { isNullOrUndefined } from 'util'; import { HttpHeaders } from '@angular/common/http'; import { Injectable, Injector } from '@angular/core'; import { Router } from '@angular/router'; @@ -27,7 +28,6 @@ import { APIURLHEADER, ERRORDATA } from 'CommonModel'; import { environment } from 'environment'; import { BehaviorSubject, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { isNullOrUndefined } from 'util'; import { ProjectModel } from '../models/VNFDModel'; import { RestService } from './RestService'; @@ -196,7 +196,9 @@ export class AuthenticationService { localStorage.setItem('token_state', null); localStorage.setItem('osmVersion', osmVersion); this.idle.stop(); - this.router.navigate(['login']).catch(); + this.router.navigate(['login']).catch((): void => { + // Catch Navigation Error + }); } /** * Logout the user & clearing the token. @@ -225,7 +227,9 @@ export class AuthenticationService { if (window.location.pathname === '/changepassword' && localStorage.getItem('username') !== null) { window.history.back(); } else if (window.location.pathname === '/' && localStorage.getItem('firstLogin') === 'true') { - this.router.navigate(['/login']).catch(); + this.router.navigate(['/login']).catch((): void => { + // Catch Navigation Error + }); } } }