[Trunk | Explore]: orcid-routing.module & orcid.module: Add LoginGuard (not FreeGuard) before loading /orcid route (user must be logged in to get tokens).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@60387 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-02-09 12:16:13 +00:00
parent 35b3d2719a
commit eeff25b18a
2 changed files with 7 additions and 3 deletions

View File

@ -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] }
])

View File

@ -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
]