Blame view

both/routes/configure.js 441 Bytes
77001041a   Ryan Glover   add support for F...
1
2
3
4
5
  FlowRouter.notFound = {
    action() {
      BlazeLayout.render( 'default', { yield: 'notFound' } );
    }
  };
6dd0ad2bb   Ryan Glover   improve authentic...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  
  Accounts.onLogin( () => {
    let currentRoute = FlowRouter.current();
    if ( currentRoute && currentRoute.route.group.name === 'public' ) {
      FlowRouter.go( 'index' );
    }
  });
  
  if ( Meteor.isClient ) {
    Tracker.autorun( () => {
      if ( !Meteor.userId() && FlowRouter.current().route ) {
        FlowRouter.go( 'login' );
      }
    });
  }