Project

General

Profile

« Previous | Next » 

Revision 60387

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

View differences:

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