Blame view

both/routes/public.js 774 Bytes
6dd0ad2bb   Ryan Glover   improve authentic...
1
2
3
4
5
6
7
8
9
  const publicRedirect = () => {
    if ( Meteor.userId() ) {
      FlowRouter.go( 'index' );
    }
  };
  
  const publicRoutes = FlowRouter.group({
    name: 'public',
    triggersEnter: [ publicRedirect ]
77001041a   Ryan Glover   add support for F...
10
  });
334a76815   Ryan Glover   little tasks and ...
11
  publicRoutes.route( '/signup', {
77001041a   Ryan Glover   add support for F...
12
    name: 'signup',
77001041a   Ryan Glover   add support for F...
13
14
15
16
    action() {
      BlazeLayout.render( 'default', { yield: 'signup' } );
    }
  });
334a76815   Ryan Glover   little tasks and ...
17
  publicRoutes.route( '/login', {
77001041a   Ryan Glover   add support for F...
18
    name: 'login',
77001041a   Ryan Glover   add support for F...
19
20
21
22
    action() {
      BlazeLayout.render( 'default', { yield: 'login' } );
    }
  });
334a76815   Ryan Glover   little tasks and ...
23
  publicRoutes.route( '/recover-password', {
77001041a   Ryan Glover   add support for F...
24
    name: 'recover-password',
77001041a   Ryan Glover   add support for F...
25
26
27
28
    action() {
      BlazeLayout.render( 'default', { yield: 'recoverPassword' } );
    }
  });
334a76815   Ryan Glover   little tasks and ...
29
  publicRoutes.route( '/reset-password/:token', {
77001041a   Ryan Glover   add support for F...
30
    name: 'reset-password',
77001041a   Ryan Glover   add support for F...
31
32
33
34
    action() {
      BlazeLayout.render( 'default', { yield: 'resetPassword' } );
    }
  });