diff --git a/login/loginGuard.guard.ts b/login/loginGuard.guard.ts index 8b1a77f5..99faad2c 100644 --- a/login/loginGuard.guard.ts +++ b/login/loginGuard.guard.ts @@ -22,23 +22,18 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild { } check(path: string): Observable | boolean { - if (Session.isLoggedIn()) { - return this.userManagementService.getUserInfo(false).pipe(map(user => { - return user !== null; - }),tap(isLoggedIn => { - if(!isLoggedIn) { - this.router.navigate(['/user-info'], { - queryParams: { - 'errorCode': LoginErrorCodes.NOT_LOGIN, - 'redirectUrl': path - } - }); - } - })); - } else { - this.router.navigate(['/user-info'], {queryParams: {'errorCode': LoginErrorCodes.NOT_LOGIN, 'redirectUrl':path}}); - return false; - } + return this.userManagementService.getUserInfo(false).pipe(map(user => { + return user !== null; + }),tap(isLoggedIn => { + if(!isLoggedIn) { + this.router.navigate(['/user-info'], { + queryParams: { + 'errorCode': LoginErrorCodes.NOT_LOGIN, + 'redirectUrl': path + } + }); + } + })); } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 5032e61b..39bb5caa 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -91,10 +91,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { getPID() { return Identifier.getResultPIDFromIdentifiers(this.result.identifiers); } - get isLoggedIn(): boolean { - return Session.isLoggedIn(); - } - + public initBeforeTitle() { if(this.result.resultType && this.result.resultType !== 'dataprovider') { this.type = this.getTypeName(this.result.resultType);