문제

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