Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

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 Jun 21, 2017
1 parent 8f451a4 commit 152f91e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions test/index.test.js
Expand Up @@ -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];
});

Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/verifier.test.js
Expand Up @@ -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);
});
Expand Down

0 comments on commit 152f91e

Please sign in to comment.