diff --git a/src/app/login/user.component.ts b/src/app/login/user.component.ts index 8de235d..360e770 100644 --- a/src/app/login/user.component.ts +++ b/src/app/login/user.component.ts @@ -11,7 +11,6 @@ import {Session} from '../openaireLibrary/login/utils/helper.class'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {SubscribeComponent} from '../utils/subscribe/subscribe.component'; import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; -import {UserManagementService} from "../openaireLibrary/services/user-management.service"; @Component({ selector: 'openaire-user', @@ -54,17 +53,14 @@ export class OpenaireUserComponent { public server: boolean = true; loggedIn:boolean = false; constructor(private _subscribeService: SubscribeService, - private _emailService: EmailService, private route: ActivatedRoute, - private userManagementService: UserManagementService){} + private _emailService: EmailService, private route: ActivatedRoute){} public ngOnInit() { + if( typeof document !== 'undefined') { + this.server = false; + this.loggedIn = Session.isLoggedIn(); + } this.route.data .subscribe((data: { envSpecific: any }) => { - this.userManagementService.isLoggedIn(data.envSpecific.userInfoUrl).subscribe( isLoggedIn => { - if( typeof document !== 'undefined') { - this.server = false; - this.loggedIn = isLoggedIn; - } - }); this.route.queryParams.subscribe( communityId => { this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);