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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -