public.js
774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const publicRedirect = () => {
if ( Meteor.userId() ) {
FlowRouter.go( 'index' );
}
};
const publicRoutes = FlowRouter.group({
name: 'public',
triggersEnter: [ publicRedirect ]
});
publicRoutes.route( '/signup', {
name: 'signup',
action() {
BlazeLayout.render( 'default', { yield: 'signup' } );
}
});
publicRoutes.route( '/login', {
name: 'login',
action() {
BlazeLayout.render( 'default', { yield: 'login' } );
}
});
publicRoutes.route( '/recover-password', {
name: 'recover-password',
action() {
BlazeLayout.render( 'default', { yield: 'recoverPassword' } );
}
});
publicRoutes.route( '/reset-password/:token', {
name: 'reset-password',
action() {
BlazeLayout.render( 'default', { yield: 'resetPassword' } );
}
});