Revision 60387
Added by Konstantina Galouni about 3 years ago
orcid-routing.module.ts | ||
---|---|---|
2 | 2 |
import { RouterModule } from '@angular/router'; |
3 | 3 |
|
4 | 4 |
import {OpenaireOrcidComponent} from './orcid.component'; |
5 |
import {FreeGuard} from "../openaireLibrary/login/freeGuard.guard"; |
|
6 | 5 |
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; |
6 |
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard"; |
|
7 | 7 |
|
8 | 8 |
@NgModule({ |
9 | 9 |
imports: [ |
10 | 10 |
RouterModule.forChild([ |
11 |
{ path: '', component: OpenaireOrcidComponent, canActivate: [FreeGuard], |
|
11 |
{ path: '', component: OpenaireOrcidComponent, |
|
12 |
canActivate: [LoginGuard], data: { |
|
13 |
redirect: '/error', community : 'openaire' |
|
14 |
}, |
|
12 | 15 |
canDeactivate: [PreviousRouteRecorder] } |
13 | 16 |
|
14 | 17 |
]) |
Also available in: Unified diff
[Trunk | Explore]: orcid-routing.module & orcid.module: Add LoginGuard (not FreeGuard) before loading /orcid route (user must be logged in to get tokens).