Advertisement
Guest User

Untitled

a guest
May 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. let first_time = false;
  2. Tracker.autorun(() => {
  3. Meteor.userId();
  4. if(first_time)
  5. FlowRouter.reload();
  6. else
  7. first_time = true;
  8. });
  9.  
  10. FlowRouter.route(States.home,{
  11. triggersEnter: [(context, redirect) => {
  12. if(!Meteor.userId())
  13. redirect(States.login);
  14. }],
  15. action(params,queryParams){
  16. BlazeLayout.render('SimpleLayout', { content: "App"});
  17. }
  18. });
  19.  
  20. FlowRouter.route(States.login,{
  21. action(params,queryParams){
  22. BlazeLayout.render('SimpleLayout', { content: "Login"});
  23. }
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement