Skip to content

Commit

Permalink
Add a missing errorr handler (#35)
Browse files Browse the repository at this point in the history
* add error handler

* OAuth 1 not 2
  • Loading branch information
Avnerus authored and daffl committed Aug 29, 2018
1 parent 1337a02 commit 9f859ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/authentication-oauth1/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { omit, pick } = _;

const merge = require('lodash.merge');
const defaultHandler = require('./express/handler');
const defaultErrorHandler = require('./express/error-handler');
const DefaultVerifier = require('./verifier');

const debug = Debug('@feathersjs/authentication-oauth1');
Expand Down Expand Up @@ -65,6 +66,7 @@ module.exports = function init (options = {}) {
const Verifier = options.Verifier || DefaultVerifier;
const formatter = options.formatter || rest.formatter;
const handler = options.handler || defaultHandler(oauth1Settings);
const errorHandler = defaultErrorHandler(oauth1Settings);

// register OAuth middleware
debug(`Registering '${name}' Express OAuth middleware`);
Expand All @@ -76,6 +78,7 @@ module.exports = function init (options = {}) {
// you would have with vanilla passport.
auth.express.authenticate(name, oauth1Settings),
handler,
errorHandler,
auth.express.emitEvents(authSettings),
auth.express.setCookie(authSettings),
auth.express.successRedirect(),
Expand Down

0 comments on commit 9f859ad

Please sign in to comment.