Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy invoker function should account an array of middlewares #748

Open
XVincentX opened this issue Jun 11, 2018 · 0 comments
Open

Policy invoker function should account an array of middlewares #748

XVincentX opened this issue Jun 11, 2018 · 0 comments
Assignees

Comments

@XVincentX
Copy link
Member

It's a common practice in Express to install an array of middlewares, rather than a single one.

This would be really handy for polices that basically export a set of middlewares.

Currently, the only way to do that is by chaining the functions one by one:

    return urlEncoded(req, res, (err) => {
      if (err) return next(err);
      tokenIntrospection(req.body.token, req.body.token_type)

While the idea would be to do:

return [urlEncoded, (req,res,next)=>{/* my stuff */}]
@XVincentX XVincentX self-assigned this Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant