How can I determine layout depending on whether the user is logged in or not in Meteor?
I have tried
Router.map(function () {
this.configure({
layoutTemplate: Meteor.userId() ? "appLayout" : "startLayout",
});
});
I get the error
Error: Meteor.userId can only be invoked in method calls. Use this.userId in publish functions.