Вопрос

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
Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top