Blame view

both/routes/authenticated.js 523 Bytes
6dd0ad2bb   Ryan Glover   improve authentic...
1
2
3
4
5
6
7
8
9
  const authenticatedRedirect = () => {
    if ( !Meteor.loggingIn() && !Meteor.userId() ) {
      FlowRouter.go( 'login' );
    }
  };
  
  const authenticatedRoutes = FlowRouter.group({
    name: 'authenticated',
    triggersEnter: [ authenticatedRedirect ]
77001041a   Ryan Glover   add support for F...
10
  });
334a76815   Ryan Glover   little tasks and ...
11
  authenticatedRoutes.route( '/', {
77001041a   Ryan Glover   add support for F...
12
    name: 'index',
77001041a   Ryan Glover   add support for F...
13
14
15
16
    action() {
      BlazeLayout.render( 'default', { yield: 'index' } );
    }
  });
6dd0ad2bb   Ryan Glover   improve authentic...
17
18
19
20
21
22
23
  
  authenticatedRoutes.route( '/dashboard', {
    name: 'dashboard',
    action() {
      BlazeLayout.render( 'default', { yield: 'dashboard' } );
    }
  });