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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -