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 -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -