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.
This PR adds
useErrorHandler
to the list of options passed toauthenticate
,authorize
andtoken
.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 forauthorize
but not fortoken
? Works similarly.