Fix a bug in guards regarding deprecated method isLoggedIn
This commit is contained in:
parent
e6b2f41c8c
commit
d9a2f3b0ee
|
@ -22,7 +22,6 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
|
|||
}
|
||||
|
||||
check(path: string): Observable<boolean> | boolean {
|
||||
if (Session.isLoggedIn()) {
|
||||
return this.userManagementService.getUserInfo(false).pipe(map(user => {
|
||||
return user !== null;
|
||||
}),tap(isLoggedIn => {
|
||||
|
@ -35,10 +34,6 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
|
|||
});
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
this.router.navigate(['/user-info'], {queryParams: {'errorCode': LoginErrorCodes.NOT_LOGIN, 'redirectUrl':path}});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
|
|
@ -91,9 +91,6 @@ 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') {
|
||||
|
|
Loading…
Reference in New Issue