[Trunk | Library]: error/isRouteEnabled.guard.ts: Bux fix: Priority to get communityId from domain (if not exists, check url parameter or data)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56236 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
168d46ae4b
commit
e31c446e1a
|
@ -28,10 +28,13 @@ export class IsRouteEnabled implements CanActivate {
|
||||||
|
|
||||||
const redirect = customRedirect ? customRedirect : '/error';
|
const redirect = customRedirect ? customRedirect : '/error';
|
||||||
const obs = this.propertiesService.subscribeEnvironment().pipe(map(res => {
|
const obs = this.propertiesService.subscribeEnvironment().pipe(map(res => {
|
||||||
|
let communityDomain = null;
|
||||||
if (!community) {
|
if (!community) {
|
||||||
community = ConnectHelper.getCommunityFromDomain(res.domain);
|
communityDomain = ConnectHelper.getCommunityFromDomain(res.domain);
|
||||||
}
|
}
|
||||||
if (!community && data['community']) { // for openaire or connect
|
if(communityDomain) {
|
||||||
|
community = communityDomain;
|
||||||
|
} else if (!community && data['community']) { // for openaire or connect
|
||||||
community = data['community'];
|
community = data['community'];
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue