1- import Debug from 'debug' ;
2- import auth from 'feathers-authentication' ;
3- import { formatter as defaultFormatter } from 'feathers-rest' ;
4- import { omit , pick , makeUrl } from 'feathers-commons' ;
5- import merge from 'lodash.merge' ;
6- import defaultHandler from './express/handler' ;
7- import DefaultVerifier from './verifier' ;
1+ const Debug = require ( 'debug' ) ;
2+ const auth = require ( 'feathers-authentication' ) ;
3+ const rest = require ( 'feathers-rest' ) ;
4+
5+ const {
6+ omit,
7+ pick,
8+ makeUrl
9+ } = require ( 'feathers-commons' ) ;
10+
11+ const merge = require ( 'lodash.merge' ) ;
12+ const defaultHandler = require ( './express/handler' ) ;
13+ const DefaultVerifier = require ( './verifier' ) ;
814
915const debug = Debug ( 'feathers-authentication-oauth1' ) ;
1016
@@ -16,7 +22,7 @@ const INCLUDE_KEYS = [
1622
1723const EXCLUDE_KEYS = [ 'Verifier' , 'Strategy' , 'formatter' ] ;
1824
19- export default function init ( options = { } ) {
25+ module . exports = function init ( options = { } ) {
2026 return function oauth1Auth ( ) {
2127 const app = this ;
2228 const _super = app . setup ;
@@ -60,7 +66,7 @@ export default function init (options = {}) {
6066 }
6167
6268 const Verifier = options . Verifier || DefaultVerifier ;
63- const formatter = options . formatter || defaultFormatter ;
69+ const formatter = options . formatter || rest . formatter ;
6470 const handler = options . handler || defaultHandler ( oauth1Settings ) ;
6571
6672 // register OAuth middleware
@@ -96,9 +102,9 @@ export default function init (options = {}) {
96102 return result ;
97103 } ;
98104 } ;
99- }
105+ } ;
100106
101107// Exposed Modules
102- Object . assign ( init , {
108+ Object . assign ( module . exports , {
103109 Verifier : DefaultVerifier
104110} ) ;
0 commit comments