SOLVED: Specifying more than one method in Router.onBeforeAction

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'}); 

?

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

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

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

1 Like