Skip to content

Commit

Permalink
add tip
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Nov 10, 2018
1 parent 99e4b43 commit 1712b2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions middlewares/ServiceGuard.js
Expand Up @@ -15,6 +15,7 @@ module.exports = {
throw new MoleculerClientError("Service token is missing", 401, "TOKEN_MISSING");

// Verify token & restricted services
// Tip: For better performance, you can cache the response because it won't change in runtime.
await ctx.call("guard.check", { token, services: action.restricted })

// Call the original handler
Expand Down

0 comments on commit 1712b2a

Please sign in to comment.