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
Post a Comment