Created
October 25, 2014 19:43
-
-
Save Streemo/5733764e1063cb9e23a7 to your computer and use it in GitHub Desktop.
This file contains 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
Router.configure({ | |
layoutTemplate: 'ApplicationLayout', | |
notFoundTemplate: 'notFound', | |
yieldTemplates: { | |
'header': {to: 'heading'} | |
} | |
}); | |
function requireLogin(pause){ | |
if (!Meteor.userId()){ | |
this.render('accessDenied') | |
pause(); | |
} | |
} | |
Router.onBeforeAction(requireLogin, {only: ['submit']}); | |
//When I go to the 'submit' route as a not-logged-in user, requireLogin is called | |
//and the if clause is satisfied, and accessDenied (a template) is rendered. | |
//I think pause() is preventing the layout from rendering... Any way to get around that? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment