SOLVED: Specifying more than one method in Router.onBeforeAction


#1

When I require login only for postSumit action I would have:

Router.onBeforeAction(requireLogin, {only: 'postSubmit'});

But, what if I want to add tagSubmit? Is there better way than

Router.onBeforeAction(requireLogin, {only: 'postSubmit'}, {only: 'tagSubmit'}); 

?


#2
Router.onBeforeAction(requireLogin, {only: ['postSubmit','tagSubmit']});

#4

Thanks a lot! So I need to put them in array. :wink:


#5

Yes, more help : http://iron-meteor.github.io/iron-router/#applying-hooks-to-specific-routes