Template request ...
if (this.userRequesting._id === Meteor.user()._id) { ... }
... verify the identity of the person. (I suspect this is not the best way to handle this, but I will save this for another question so as not to overload this question).
My problem is that this leads to a huge cascade of errors, assuming that Meteor.user() is undefined, only on pageload ... After loading the page, this code runs without problems. Clearly, there is a temporary hole (or, as I believe) where Meteor.user() remains unassigned for a split second when the page loads. Replacing the above code with ...
____________ if (Meteor.user() && this.userRequesting._id == Meteor.user()._id) { ... }
... fixes the problem, but ... Come on ... It can't be kosher. What assumption am I mistaken about patterns and the Meteor?
If appropriate, I use accounts-password as my account manager.
[Edit]: This seems to be the same problem , but I leave this question on the ground that I am looking for a fix, not a workaround. (I already know that checking Meteor.user() resolves this.)
source share