Last active
January 2, 2016 05:09
-
-
Save aaronthorp/8255496 to your computer and use it in GitHub Desktop.
Iron-Router - Login check for each route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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