meteor - Iron Router OnBefore Hook with Params URL Not Calling Function -


i looking restrict access page using iron router, before function doesn't seem running.

# limit challenges can seen members. ismemberhook = () ->     challenge = challenges.findone _id: @params._id     if meteor.userid() in challenge.members         @next()     else         @redirect '/'  router.onbeforeaction ismemberhook,     only: ['/challenge/:_id'] 

turns out routes "/" need use ".".

so in case used:

only: ["challenge.:_id"] 

problem solved!


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -