diff --git a/explore/src/app/orcid/orcid-routing.module.ts b/explore/src/app/orcid/orcid-routing.module.ts index 3768510b..79c020bf 100644 --- a/explore/src/app/orcid/orcid-routing.module.ts +++ b/explore/src/app/orcid/orcid-routing.module.ts @@ -2,13 +2,16 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import {OpenaireOrcidComponent} from './orcid.component'; -import {FreeGuard} from "../openaireLibrary/login/freeGuard.guard"; import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard"; @NgModule({ imports: [ RouterModule.forChild([ - { path: '', component: OpenaireOrcidComponent, canActivate: [FreeGuard], + { path: '', component: OpenaireOrcidComponent, + canActivate: [LoginGuard], data: { + redirect: '/error', community : 'openaire' + }, canDeactivate: [PreviousRouteRecorder] } ]) diff --git a/explore/src/app/orcid/orcid.module.ts b/explore/src/app/orcid/orcid.module.ts index 04c36917..fb566187 100644 --- a/explore/src/app/orcid/orcid.module.ts +++ b/explore/src/app/orcid/orcid.module.ts @@ -6,6 +6,7 @@ import {OrcidRoutingModule} from './orcid-routing.module'; import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; import {FormsModule} from "@angular/forms"; import {OrcidModule} from "../openaireLibrary/orcid/orcid.module"; +import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard"; @NgModule({ imports: [ @@ -15,7 +16,7 @@ import {OrcidModule} from "../openaireLibrary/orcid/orcid.module"; declarations: [ OpenaireOrcidComponent ], - providers: [PreviousRouteRecorder], + providers: [PreviousRouteRecorder, LoginGuard], exports: [ OpenaireOrcidComponent ]