iron-router-progress
iron-router-progress copied to clipboard
Rendering a landing page resulting in progress bar not completing.
Hi,
I am facing an issue I was hoping you could help with. I have a secured app that uses the progress bar and generally all is well, except when I have an onBeforeAction hook that will render a landing page if the user is not logged in.
When I visit a page and Im not secured, the landing page that is render the progress bar, as well as the spinner but neither then disappears. I assume this is because the hook has not completed as I don't have a next() method call. Not sure on the best way to solve this (still fairly new). Please see below for an example of my hook code:
var requireLogin = function() {
if (!Meteor.user()) {
if (Meteor.loggingIn()) {
this.render(this.loadingTemplate);
} else {
this.render('landingPage');
}
} else {
this.next();
}
}
Router.onBeforeAction(requireLogin, {except: ['landingPage']});
Thanks
Dave
@davidmulligan I am having the exact same issue.
Any solutions on this? It is still getting stuck
+1, any solutions?
I have the same problem ?
I usually called this.stop()
or something similar manually, if you don't call this.next()
. Must admit I don't quite remember the feature/syntax now, as it has been a while since I last had to implement such routes.