Question

I am logged into my website with accounts-facebook. When I load a page, onBeforeAction is called, and Meteor.user() is undefined. It loads the login template, and I see it briefly. Then onBeforeAction is re-run, and Meteor.user() is an object, and a different template is loaded. How do I either:

  • wait in onBeforeAction until the user is recognized
  • have onBeforeAction called after the user is recognized
Was it helpful?

Solution

You should use fast-render package. It makes Meteor.user() to be populated from the start. Simply run:

mrt add fast-render

Check out this detailed article on how it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top