[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:
parent
35b3d2719a
commit
eeff25b18a
|
@ -2,13 +2,16 @@ import { NgModule } from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import {OpenaireOrcidComponent} from './orcid.component';
|
import {OpenaireOrcidComponent} from './orcid.component';
|
||||||
import {FreeGuard} from "../openaireLibrary/login/freeGuard.guard";
|
|
||||||
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{ path: '', component: OpenaireOrcidComponent, canActivate: [FreeGuard],
|
{ path: '', component: OpenaireOrcidComponent,
|
||||||
|
canActivate: [LoginGuard], data: {
|
||||||
|
redirect: '/error', community : 'openaire'
|
||||||
|
},
|
||||||
canDeactivate: [PreviousRouteRecorder] }
|
canDeactivate: [PreviousRouteRecorder] }
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {OrcidRoutingModule} from './orcid-routing.module';
|
||||||
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
import {FormsModule} from "@angular/forms";
|
import {FormsModule} from "@angular/forms";
|
||||||
import {OrcidModule} from "../openaireLibrary/orcid/orcid.module";
|
import {OrcidModule} from "../openaireLibrary/orcid/orcid.module";
|
||||||
|
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -15,7 +16,7 @@ import {OrcidModule} from "../openaireLibrary/orcid/orcid.module";
|
||||||
declarations: [
|
declarations: [
|
||||||
OpenaireOrcidComponent
|
OpenaireOrcidComponent
|
||||||
],
|
],
|
||||||
providers: [PreviousRouteRecorder],
|
providers: [PreviousRouteRecorder, LoginGuard],
|
||||||
exports: [
|
exports: [
|
||||||
OpenaireOrcidComponent
|
OpenaireOrcidComponent
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue