Permalink
Browse files

Step 9.10: Require user to access PartyDetails

  • Loading branch information...
1 parent b73e872 commit 3994e1a2947c1dd8c5450cfb516ae3c844aa16f3 @kamilkisiela kamilkisiela committed with DAB0mB Sep 21, 2016
Showing with 7 additions and 1 deletion.
  1. +7 −1 client/imports/app/app.routes.ts
@@ -1,9 +1,15 @@
import { Route } from '@angular/router';
+import { Meteor } from 'meteor/meteor';
import { PartiesListComponent } from './parties/parties-list.component';
import { PartyDetailsComponent } from './parties/party-details.component';
export const routes: Route[] = [
{ path: '', component: PartiesListComponent },
- { path: 'party/:partyId', component: PartyDetailsComponent }
+ { path: 'party/:partyId', component: PartyDetailsComponent, canActivate: ['canActivateForLoggedIn'] }
];
+
+export const ROUTES_PROVIDERS = [{
+ provide: 'canActivateForLoggedIn',
+ useValue: () => !! Meteor.userId()
+}];

0 comments on commit 3994e1a

Please sign in to comment.