Connect: User Component reset to session is logged in.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@57069 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-09-13 09:25:53 +00:00
parent 3aaaf93625
commit 91d0246b62
1 changed files with 5 additions and 9 deletions

View File

@ -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);