Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Last active January 2, 2016 05:09
Show Gist options
  • Save aaronthorp/8255496 to your computer and use it in GitHub Desktop.
Save aaronthorp/8255496 to your computer and use it in GitHub Desktop.
Iron-Router - Login check for each route
RouteController.extend({
before: function() {
if (_.isNull(Meteor.user()) && Router.current().route.name != 'loginPage') {
console.log("Redirect to login!");
this.stop();
Router.go('loginPage');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment