Skip to content

Instantly share code, notes, and snippets.

@ToJa92
Created April 17, 2014 17:44
Show Gist options
  • Save ToJa92/11000615 to your computer and use it in GitHub Desktop.
Save ToJa92/11000615 to your computer and use it in GitHub Desktop.
An iron-router `onBeforeAction` method that renders a template if no user is logged in. It should not be used to check whether a user is logged in or not.
onBeforeAction: function(pause) {
if(! Meteor.user()) {
this.render("adminLogin");
pause();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment