oauthjs / express-oauth-server

Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js
MIT License
484 stars 384 forks source link

Enable the use of useErrorHandler per route #71

Open d-fischer opened 6 years ago

d-fischer commented 6 years ago

This PR adds useErrorHandler to the list of options passed to authenticate, authorize and token.

Maybe you want certain resources of your API to work with or without authentication, but not all of them? You can do that now using app.get('/your/resource', oauth.authenticate({ useErrorHandler: true }), () => {});. Maybe you want a custom error handler for authorize but not for token? Works similarly.