diff --git a/error/isRouteEnabled.guard.ts b/error/isRouteEnabled.guard.ts index f65b488a..44f272bf 100644 --- a/error/isRouteEnabled.guard.ts +++ b/error/isRouteEnabled.guard.ts @@ -25,14 +25,15 @@ export class IsRouteEnabled implements CanActivate { check(data: Data, community: string, path: string): Observable | boolean { const customRedirect = data['redirect']; - if (!community && data['community']) { // for openaire - community = data['community']; - } + const redirect = customRedirect ? customRedirect : '/error'; const obs = this.propertiesService.subscribeEnvironment().pipe(map(res => { if (!community) { community = ConnectHelper.getCommunityFromDomain(res.domain); } + if (!community && data['community']) { // for openaire or connect + community = data['community']; + } return res; }),mergeMap(prop => { if (!community) { // no community to check - return true