i’m making a app where you have to login to use it.
The problem is:
Router.configure({
layoutTemplate: 'mainLayout'
});
How to disable it so I only use the welcome template with the login form
The code below almost work, but it shows the welcome template and the mainLayout template
Router.onBeforeAction(function () {
// all properties available in the route function
// are also available here such as this.params
if (!Meteor.userId()) {
// if the user is not logged in, render the Login template
this.render('welcome');
} else {
// otherwise don't hold up the rest of hooks or our route/action function
// from running
this.next();
}
});