Skip to content

Commit

Permalink
use the correct default config key. Closes #21 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekryski authored and daffl committed Aug 29, 2018
1 parent 2188a75 commit 497739c
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/authentication-local/src/index.js
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 5 additions & 5 deletions packages/authentication-local/test/index.test.js
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion packages/authentication-local/test/verifier.test.js
Original file line number Diff line number Diff line change
@@ -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);
});

0 comments on commit 497739c

Please sign in to comment.