From 497739c4e887d4d5ef62173aaccfe75453c0b8cc Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Wed, 21 Jun 2017 14:24:23 -0600 Subject: [PATCH] use the correct default config key. Closes #21 (#22) --- packages/authentication-local/src/index.js | 2 +- packages/authentication-local/test/index.test.js | 10 +++++----- packages/authentication-local/test/verifier.test.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/authentication-local/src/index.js b/packages/authentication-local/src/index.js index ff9c796771..bdc11bdfb2 100644 --- a/packages/authentication-local/src/index.js +++ b/packages/authentication-local/src/index.js @@ -30,7 +30,7 @@ export default function init(options = {}) { } let name = options.name || defaults.name; - let authOptions = app.get('auth') || {}; + let authOptions = app.get('authentication') || {}; let localOptions = authOptions[name] || {}; // NOTE (EK): Pull from global auth config to support legacy auth for an easier transition. diff --git a/packages/authentication-local/test/index.test.js b/packages/authentication-local/test/index.test.js index 75bca28659..be87ec471c 100644 --- a/packages/authentication-local/test/index.test.js +++ b/packages/authentication-local/test/index.test.js @@ -73,7 +73,7 @@ describe('feathers-authentication-local', () => { sinon.spy(passportLocal, 'Strategy'); app.configure(local({ custom: true })); app.setup(); - authOptions = app.get('auth'); + authOptions = app.get('authentication'); args = passportLocal.Strategy.getCall(0).args[0]; }); @@ -122,9 +122,9 @@ describe('feathers-authentication-local', () => { it('pulls options from global config', () => { sinon.spy(passportLocal, 'Strategy'); - let authOptions = app.get('auth'); + let authOptions = app.get('authentication'); authOptions.local = { usernameField: 'username' }; - app.set('auth', authOptions); + app.set('authentication', authOptions); app.configure(local()); app.setup(); @@ -137,9 +137,9 @@ describe('feathers-authentication-local', () => { it('pulls options from global config with custom name', () => { sinon.spy(passportLocal, 'Strategy'); - let authOptions = app.get('auth'); + let authOptions = app.get('authentication'); authOptions.custom = { usernameField: 'username' }; - app.set('auth', authOptions); + app.set('authentication', authOptions); app.configure(local({ name: 'custom' })); app.setup(); diff --git a/packages/authentication-local/test/verifier.test.js b/packages/authentication-local/test/verifier.test.js index 39a9370224..644fb8946c 100644 --- a/packages/authentication-local/test/verifier.test.js +++ b/packages/authentication-local/test/verifier.test.js @@ -31,7 +31,7 @@ describe('Verifier', () => { app.use('users', service) .configure(authentication({ secret: 'supersecret' })); - options = Object.assign({}, defaults, app.get('auth')); + options = Object.assign({}, defaults, app.get('authentication')); verifier = new Verifier(app, options); });